From 57855bf8e7dff19166bbbec2fd2c7fd0c5feb6d8 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/ocm/create/cluster/cmd.go b/cmd/ocm/create/cluster/cmd.go index 13a9ccf3..dcdcb89b 100644 --- a/cmd/ocm/create/cluster/cmd.go +++ b/cmd/ocm/create/cluster/cmd.go @@ -510,9 +510,10 @@ 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 +530,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 +554,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)