Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that disagreeing to provider ToS will abort provisioning #2899

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 fmt.Errorf("%s provisioning stopped.", provider.DisplayName)
}

return err
Expand Down