Skip to content

Commit

Permalink
fix(rdb): fix custom type in rdb instance engine (scaleway#4081)
Browse files Browse the repository at this point in the history
  • Loading branch information
jremy42 committed Aug 29, 2024
1 parent c1dcd24 commit 7d8e040
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/namespaces/rdb/v1/custom_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ type CreateInstanceResult struct {
Password string `json:"password"`
}

type rdbCreateInstanceRequestCustom struct {
*rdbSDK.CreateInstanceRequest
InitEndpoints []*rdbEndpointSpecCustom `json:"init-endpoints"`
GeneratePassword bool
}

func createInstanceResultMarshalerFunc(i interface{}, opt *human.MarshalOpt) (string, error) {
instanceResult := i.(CreateInstanceResult)

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

func autoCompleteDatabaseEngines(ctx context.Context, prefix string, request any) core.AutocompleteSuggestions {
req := request.(*rdbSDK.CreateInstanceRequest)
req := request.(rdbCreateInstanceRequestCustom)
suggestion := core.AutocompleteSuggestions(nil)
client := core.ExtractClient(ctx)
api := rdbSDK.NewAPI(client)
Expand All @@ -228,12 +234,6 @@ func autoCompleteDatabaseEngines(ctx context.Context, prefix string, request any
}

func instanceCreateBuilder(c *core.Command) *core.Command {
type rdbCreateInstanceRequestCustom struct {
*rdbSDK.CreateInstanceRequest
InitEndpoints []*rdbEndpointSpecCustom `json:"init-endpoints"`
GeneratePassword bool
}

c.ArgSpecs.AddBefore("init-endpoints.{index}.private-network.private-network-id", &core.ArgSpec{
Name: "init-endpoints.{index}.load-balancer",
Short: "Will configure a load-balancer endpoint along with your private network endpoint if true",
Expand Down

0 comments on commit 7d8e040

Please sign in to comment.