Skip to content

Commit

Permalink
Merge pull request #562 from cristianoveiga/OCM-4016
Browse files Browse the repository at this point in the history
fixed setting isGcpMarketplace for non interactive mode
  • Loading branch information
gdbranco authored Oct 9, 2023
2 parents d9b1346 + 57855bf commit eecf5d4
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 eecf5d4

Please sign in to comment.