Skip to content

Commit

Permalink
OCM-4186 | Feat | Changed marketplace-gcp-terms error message for non…
Browse files Browse the repository at this point in the history
…-interactive mode (#569)

* Changed marketplace-gcp-terms error message for non-interactive mode

* Fixed linter error
  • Loading branch information
tirthct committed Oct 10, 2023
1 parent 47cd35c commit 0d3f4c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/ocm/create/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0d3f4c3

Please sign in to comment.