From 0d3f4c3e607a5e2f71789fab1ee282f100e5e334 Mon Sep 17 00:00:00 2001 From: tirthct Date: Tue, 10 Oct 2023 12:38:22 -0700 Subject: [PATCH] OCM-4186 | Feat | Changed marketplace-gcp-terms error message for non-interactive mode (#569) * Changed marketplace-gcp-terms error message for non-interactive mode * Fixed linter error --- cmd/ocm/create/cluster/cmd.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/ocm/create/cluster/cmd.go b/cmd/ocm/create/cluster/cmd.go index d928ba74..76a3b40b 100644 --- a/cmd/ocm/create/cluster/cmd.go +++ b/cmd/ocm/create/cluster/cmd.go @@ -48,7 +48,10 @@ const ( defaultIngressNamespaceOwnershipPolicyFlag = "default-ingress-namespace-ownership-policy" gcpTermsAgreementsHyperlink = "https://console.cloud.google.com" + "/marketplace/agreements/redhat-marketplace/red-hat-openshift-dedicated" - gcpTermsAgreementError = "Please accept Google Terms and Agreements in order to proceed" + gcpTermsAgreementInteractiveError = "Please accept Google Terms and Agreements in order to proceed" + gcpTermsAgreementNonInteractiveError = "Review and accept Google Terms and Agreements on " + + gcpTermsAgreementsHyperlink + ". Set the flag --marketplace-gcp-terms to true " + + "once agreed in order to proceed further." ) var args struct { @@ -539,7 +542,10 @@ func preRun(cmd *cobra.Command, argv []string) error { } } if !args.marketplaceGcpTerms { - return fmt.Errorf(gcpTermsAgreementError) + if args.interactive { + return fmt.Errorf(gcpTermsAgreementInteractiveError) + } + return fmt.Errorf(gcpTermsAgreementNonInteractiveError) } } else { err = arguments.PromptOneOf(fs, "provider", providers)