From df6c3dec9324f9efd2e02bae708ebd44402cff36 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Thu, 12 Oct 2023 12:35:01 +0200 Subject: [PATCH 1/2] Ensure that disagreeing to provider ToS will abort provisioning --- internal/command/extensions/core/core.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/command/extensions/core/core.go b/internal/command/extensions/core/core.go index 84ae6d61bf..86b18d34d3 100644 --- a/internal/command/extensions/core/core.go +++ b/internal/command/extensions/core/core.go @@ -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 @@ -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)) } return err From eb80589795b6fd0ccf77b8f87006260a2b197788 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Thu, 12 Oct 2023 12:43:46 +0200 Subject: [PATCH 2/2] Fix --- internal/command/extensions/core/core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/extensions/core/core.go b/internal/command/extensions/core/core.go index 86b18d34d3..1b0d72c728 100644 --- a/internal/command/extensions/core/core.go +++ b/internal/command/extensions/core/core.go @@ -243,7 +243,7 @@ func AgreeToProviderTos(ctx context.Context, provider gql.ExtensionProviderData, OrganizationId: org.Id, }) } else { - return errors.New(fmt.Sprintf("%s provisioning stopped.", provider.DisplayName)) + return fmt.Errorf("%s provisioning stopped.", provider.DisplayName) } return err