@@ -46,6 +46,9 @@ const (
46
46
defaultIngressExcludedNamespacesFlag = "default-ingress-excluded-namespaces"
47
47
defaultIngressWildcardPolicyFlag = "default-ingress-wildcard-policy"
48
48
defaultIngressNamespaceOwnershipPolicyFlag = "default-ingress-namespace-ownership-policy"
49
+ gcpTermsAgreementsHyperlink = "https://console.cloud.google.com" +
50
+ "/marketplace/agreements/redhat-marketplace/red-hat-openshift-dedicated"
51
+ gcpTermsAgreementError = "Please accept Google Terms and Agreements in order to proceed"
49
52
)
50
53
51
54
var args struct {
@@ -71,6 +74,7 @@ var args struct {
71
74
gcpServiceAccountFile arguments.FilePath
72
75
etcdEncryption bool
73
76
subscriptionType string
77
+ marketplaceGcpTerms bool
74
78
75
79
// Scaling options
76
80
computeMachineType string
@@ -324,6 +328,15 @@ func init() {
324
328
)
325
329
arguments .SetQuestion (fs , "subscription-type" , "Subscription type:" )
326
330
Cmd .RegisterFlagCompletionFunc ("subscription-type" , arguments .MakeCompleteFunc (getSubscriptionTypeOptions ))
331
+
332
+ fs .BoolVar (
333
+ & args .marketplaceGcpTerms ,
334
+ "marketplace-gcp-terms" ,
335
+ false ,
336
+ fmt .Sprintf ("Review and accept Google Terms and Agreements on %s. " +
337
+ "Set the flag to true once agreed in order to proceed further." , gcpTermsAgreementsHyperlink ),
338
+ )
339
+ arguments .SetQuestion (fs , "marketplace-gcp-terms" , "I have accepted Google Terms and Agreements:" )
327
340
}
328
341
329
342
func osdProviderOptions (_ * sdk.Connection ) ([]arguments.Option , error ) {
@@ -516,6 +529,18 @@ func preRun(cmd *cobra.Command, argv []string) error {
516
529
if isGcpMarketplace {
517
530
fmt .Println ("setting provider to" , c .ProviderGCP )
518
531
args .provider = c .ProviderGCP
532
+ fmt .Println ("setting ccs to 'true'" )
533
+ args .ccs .Enabled = true
534
+ if args .interactive {
535
+ fmt .Println ("Review and accept Google Terms and Agreements on" , gcpTermsAgreementsHyperlink )
536
+ err = arguments .PromptBool (fs , "marketplace-gcp-terms" )
537
+ if err != nil {
538
+ return err
539
+ }
540
+ }
541
+ if ! args .marketplaceGcpTerms {
542
+ return fmt .Errorf (gcpTermsAgreementError )
543
+ }
519
544
} else {
520
545
err = arguments .PromptOneOf (fs , "provider" , providers )
521
546
if err != nil {
@@ -529,11 +554,6 @@ func preRun(cmd *cobra.Command, argv []string) error {
529
554
args .clusterWideProxy .Enabled = true
530
555
}
531
556
532
- // If marketplace-gcp subscription type is used, ccs should by default be true
533
- if isGcpMarketplace {
534
- fmt .Println ("setting ccs to 'true'" )
535
- args .ccs .Enabled = true
536
- }
537
557
err = promptCCS (fs , args .ccs .Enabled )
538
558
if err != nil {
539
559
return err
0 commit comments