From 46ef494c400d8e3e969ae9207215ab12f7e7c1c1 Mon Sep 17 00:00:00 2001 From: Cristiano Veiga Date: Fri, 6 Oct 2023 10:40:45 -0400 Subject: [PATCH] fixed setting isGcpMarketplaceSubscriptionType for non interactive mode --- cmd/ocm/create/cluster/cmd.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/ocm/create/cluster/cmd.go b/cmd/ocm/create/cluster/cmd.go index 13a9ccf3..52e477f3 100644 --- a/cmd/ocm/create/cluster/cmd.go +++ b/cmd/ocm/create/cluster/cmd.go @@ -510,9 +510,9 @@ func preRun(cmd *cobra.Command, argv []string) error { // If marketplace-gcp subscription type is used, provider can only be GCP gcpBillingModel, _ := billing.GetBillingModel(connection, billing.MarketplaceGcpSubscriptionType) gcpSubscriptionTypeTemplate := subscriptionTypeOption(gcpBillingModel.ID(), gcpBillingModel.Description()) - isGcpMarketplaceSubscriptionType := args.subscriptionType == gcpSubscriptionTypeTemplate.Value + isGcpMarketplace := parseSubscriptionType(args.subscriptionType) == parseSubscriptionType(gcpSubscriptionTypeTemplate.Value) - if isGcpMarketplaceSubscriptionType { + if isGcpMarketplace { fmt.Println("setting provider to", c.ProviderGCP) args.provider = c.ProviderGCP } else { @@ -529,7 +529,7 @@ func preRun(cmd *cobra.Command, argv []string) error { } // If marketplace-gcp subscription type is used, ccs should by default be true - if isGcpMarketplaceSubscriptionType { + if isGcpMarketplace { fmt.Println("setting ccs to 'true'") args.ccs.Enabled = true } @@ -553,8 +553,8 @@ func preRun(cmd *cobra.Command, argv []string) error { } var gcpMarketplaceEnabled string - if isGcpMarketplaceSubscriptionType { - gcpMarketplaceEnabled = strconv.FormatBool(isGcpMarketplaceSubscriptionType) + if isGcpMarketplace { + gcpMarketplaceEnabled = strconv.FormatBool(isGcpMarketplace) } versions, defaultVersion, err := getVersionOptionsWithDefault(connection, args.channelGroup, gcpMarketplaceEnabled)