Skip to content

Commit

Permalink
fixed setting isGcpMarketplaceSubscriptionType for non interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoveiga committed Oct 6, 2023
1 parent d9b1346 commit 57855bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/ocm/create/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand All @@ -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)
Expand Down

0 comments on commit 57855bf

Please sign in to comment.