Skip to content

Commit

Permalink
Fix golangci-lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gogen120 committed Sep 23, 2024
1 parent 68fc5f2 commit 9fff5cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions selectel/dbaas.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func updateDatastoreBackups(ctx context.Context, d *schema.ResourceData, client
return nil
}

func getResizeOpts(ctx context.Context, d *schema.ResourceData, client *dbaas.API) (error, dbaas.DatastoreResizeOpts) {
func getResizeOpts(ctx context.Context, d *schema.ResourceData, client *dbaas.API) (dbaas.DatastoreResizeOpts, error) {
var resizeOpts dbaas.DatastoreResizeOpts
nodeCount := d.Get("node_count").(int)
resizeOpts.NodeCount = nodeCount
Expand All @@ -333,26 +333,26 @@ func getResizeOpts(ctx context.Context, d *schema.ResourceData, client *dbaas.AP
flavorSet := flavorRaw.(*schema.Set)
flavor, err := resourceDBaaSDatastoreV1FlavorFromSet(flavorSet)
if err != nil {
return errParseDatastoreV1Resize(err), resizeOpts
return resizeOpts, errParseDatastoreV1Resize(err)
}
resizeOpts.Flavor = flavor
}

typeID := d.Get("type_id").(string)
datastoreType, err := client.DatastoreType(ctx, typeID)
if err != nil {
return errors.New("Couldnt get datastore type with id" + typeID), resizeOpts
return resizeOpts, errors.New("Couldnt get datastore type with id" + typeID)
}

if datastoreType.Engine == "redis" {
resizeOpts.Flavor = nil
}

return nil, resizeOpts
return resizeOpts, nil
}

func resizeDatastore(ctx context.Context, d *schema.ResourceData, client *dbaas.API) error {
err, resizeOpts := getResizeOpts(ctx, d, client)
resizeOpts, err := getResizeOpts(ctx, d, client)
if err != nil {
return errUpdatingObject(objectDatastore, d.Id(), err)
}
Expand Down

0 comments on commit 9fff5cf

Please sign in to comment.