Skip to content

Commit

Permalink
Merge branch 'main' into ocm-3993
Browse files Browse the repository at this point in the history
  • Loading branch information
tirthct committed Oct 9, 2023
2 parents f85a094 + eecf5d4 commit 4dcb78b
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 @@ -521,9 +521,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 @@ -540,7 +541,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
fmt.Println("Review and accept Google Terms and Agreements on", gcpTermsAgreementsHyperlink)
Expand Down Expand Up @@ -572,8 +573,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 4dcb78b

Please sign in to comment.