Skip to content

Commit 7d8e040

Browse files
authored
fix(rdb): fix custom type in rdb instance engine (#4081)
1 parent c1dcd24 commit 7d8e040

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

internal/namespaces/rdb/v1/custom_instance.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ type CreateInstanceResult struct {
5656
Password string `json:"password"`
5757
}
5858

59+
type rdbCreateInstanceRequestCustom struct {
60+
*rdbSDK.CreateInstanceRequest
61+
InitEndpoints []*rdbEndpointSpecCustom `json:"init-endpoints"`
62+
GeneratePassword bool
63+
}
64+
5965
func createInstanceResultMarshalerFunc(i interface{}, opt *human.MarshalOpt) (string, error) {
6066
instanceResult := i.(CreateInstanceResult)
6167

@@ -203,7 +209,7 @@ func autoCompleteNodeType(ctx context.Context, prefix string, request any) core.
203209
}
204210

205211
func autoCompleteDatabaseEngines(ctx context.Context, prefix string, request any) core.AutocompleteSuggestions {
206-
req := request.(*rdbSDK.CreateInstanceRequest)
212+
req := request.(rdbCreateInstanceRequestCustom)
207213
suggestion := core.AutocompleteSuggestions(nil)
208214
client := core.ExtractClient(ctx)
209215
api := rdbSDK.NewAPI(client)
@@ -228,12 +234,6 @@ func autoCompleteDatabaseEngines(ctx context.Context, prefix string, request any
228234
}
229235

230236
func instanceCreateBuilder(c *core.Command) *core.Command {
231-
type rdbCreateInstanceRequestCustom struct {
232-
*rdbSDK.CreateInstanceRequest
233-
InitEndpoints []*rdbEndpointSpecCustom `json:"init-endpoints"`
234-
GeneratePassword bool
235-
}
236-
237237
c.ArgSpecs.AddBefore("init-endpoints.{index}.private-network.private-network-id", &core.ArgSpec{
238238
Name: "init-endpoints.{index}.load-balancer",
239239
Short: "Will configure a load-balancer endpoint along with your private network endpoint if true",

0 commit comments

Comments
 (0)