Skip to content

Commit

Permalink
Ensure that disagreeing to provider ToS will abort provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jsierles committed Oct 12, 2023
1 parent 08aa3a4 commit df6c3de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/command/extensions/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func AgreeToProviderTos(ctx context.Context, provider gql.ExtensionProviderData,
}

// Prompt the user to agree to the provider ToS
confirmTos, err := prompt.Confirm(ctx, fmt.Sprintf("To provision this %s, you must agree on behalf of your organization to the %s Terms Of Service at %s. Do you agree?", provider.ResourceName, provider.DisplayName, provider.TosUrl))
confirmTos, err := prompt.Confirm(ctx, fmt.Sprintf("To provision %s %ss, you must agree on behalf of your organization to the %s Terms Of Service at %s. Do you agree?", provider.DisplayName, provider.ResourceName, provider.DisplayName, provider.TosUrl))

if err != nil {
return err
Expand All @@ -242,6 +242,8 @@ func AgreeToProviderTos(ctx context.Context, provider gql.ExtensionProviderData,
AddOnProviderName: provider.Name,
OrganizationId: org.Id,
})
} else {
return errors.New(fmt.Sprintf("%s provisioning stopped.", provider.DisplayName))

Check failure on line 246 in internal/command/extensions/core/core.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest, .)

S1028: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (gosimple)
}

return err
Expand Down

0 comments on commit df6c3de

Please sign in to comment.