@@ -210,11 +210,6 @@ func runCreate(opts *options) error {
210
210
f .Logger .Info (f .Localizer .MustLocalize ("service.info.termsCheck" , localize .NewEntry ("TermsURL" , termsURL )))
211
211
return nil
212
212
}
213
-
214
- err = ValidateBillingModel (opts .billingModel )
215
- if err != nil {
216
- return err
217
- }
218
213
}
219
214
220
215
var payload * kafkamgmtclient.KafkaRequestPayload
@@ -230,26 +225,6 @@ func runCreate(opts *options) error {
230
225
}
231
226
} else {
232
227
233
- orgQuota , newErr := accountmgmtutil .GetOrgQuotas (f , & constants .Kafka .Ams )
234
- if newErr != nil {
235
- return newErr
236
- }
237
-
238
- marketplaceInfo := accountmgmtutil.MarketplaceInfo {
239
- BillingModel : opts .billingModel ,
240
- Provider : opts .marketplace ,
241
- CloudAccountID : opts .marketplaceAcctId ,
242
- }
243
-
244
- userQuota , err = accountmgmtutil .SelectQuotaForUser (f , orgQuota , marketplaceInfo )
245
- if err != nil {
246
- return err
247
- }
248
-
249
- userQuotaJSON , _ := json .MarshalIndent (userQuota , "" , " " )
250
- f .Logger .Debug ("Selected Quota object:" )
251
- f .Logger .Debug (string (userQuotaJSON ))
252
-
253
228
if opts .provider == "" {
254
229
opts .provider = defaultProvider
255
230
}
@@ -264,20 +239,45 @@ func runCreate(opts *options) error {
264
239
CloudProvider : & opts .provider ,
265
240
}
266
241
267
- if userQuota . BillingModel == accountmgmtutil . QuotaMarketplaceType && userQuota . CloudAccounts != nil {
242
+ if ! opts . bypassChecks {
268
243
269
- payload .Marketplace = kafkamgmtclient.NullableString {}
270
- payload .Marketplace .Set ((* userQuota .CloudAccounts )[0 ].CloudProviderId )
271
- payload .BillingCloudAccountId = kafkamgmtclient.NullableString {}
272
- payload .BillingCloudAccountId .Set ((* userQuota .CloudAccounts )[0 ].CloudAccountId )
273
- }
244
+ err = ValidateBillingModel (opts .billingModel )
245
+ if err != nil {
246
+ return err
247
+ }
274
248
275
- if opts .billingModel != "" {
276
- payload .BillingModel = kafkamgmtclient.NullableString {}
277
- payload .BillingModel .Set (& opts .billingModel )
278
- }
249
+ orgQuotas , newErr := accountmgmtutil .GetOrgQuotas (f , & constants .Kafka .Ams )
250
+ if newErr != nil {
251
+ return newErr
252
+ }
253
+
254
+ marketplaceInfo := accountmgmtutil.MarketplaceInfo {
255
+ BillingModel : opts .billingModel ,
256
+ Provider : opts .marketplace ,
257
+ CloudAccountID : opts .marketplaceAcctId ,
258
+ }
259
+
260
+ userQuota , err = accountmgmtutil .SelectQuotaForUser (f , orgQuotas , marketplaceInfo )
261
+ if err != nil {
262
+ return err
263
+ }
264
+
265
+ userQuotaJSON , _ := json .MarshalIndent (userQuota , "" , " " )
266
+ f .Logger .Debug ("Selected Quota object:" )
267
+ f .Logger .Debug (string (userQuotaJSON ))
268
+
269
+ if userQuota .BillingModel == accountmgmtutil .QuotaMarketplaceType && userQuota .CloudAccounts != nil {
270
+ payload .Marketplace = kafkamgmtclient.NullableString {}
271
+ payload .Marketplace .Set ((* userQuota .CloudAccounts )[0 ].CloudProviderId )
272
+ payload .BillingCloudAccountId = kafkamgmtclient.NullableString {}
273
+ payload .BillingCloudAccountId .Set ((* userQuota .CloudAccounts )[0 ].CloudAccountId )
274
+ }
275
+
276
+ if opts .billingModel != "" {
277
+ payload .BillingModel = kafkamgmtclient.NullableString {}
278
+ payload .BillingModel .Set (& opts .billingModel )
279
+ }
279
280
280
- if ! opts .bypassChecks {
281
281
validator := ValidatorInput {
282
282
provider : opts .provider ,
283
283
region : opts .region ,
0 commit comments