Skip to content

Commit 16d1a2f

Browse files
feat(kafka create): return appropriate error for no regions (#1790)
1 parent cf0ebc0 commit 16d1a2f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pkg/cmd/kafka/create/create.go

+4
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,10 @@ func promptKafkaPayload(opts *options, constants *remote.DynamicServiceConstants
552552
return nil, err
553553
}
554554

555+
if len(regionIDs) == 0 {
556+
return nil, f.Localizer.MustLocalizeError("kafka.create.error.noRegionSupported")
557+
}
558+
555559
regionPrompt := &survey.Select{
556560
Message: f.Localizer.MustLocalize("kafka.create.input.cloudRegion.message"),
557561
Options: regionIDs,

pkg/core/localize/locales/en/cmd/kafka.en.toml

+3
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ one = '''
414414
provided instance size is not valid. Valid sizes: {{.ValidSizes}}
415415
'''
416416

417+
[kafka.create.error.noRegionSupported]
418+
one = 'all regions in the selected cloud provider are temporarily unavailable'
419+
417420
[kafka.create.error.billing.invalid]
418421
one = '''
419422
provided billing account id and provider are invalid {{.Billing}}

0 commit comments

Comments
 (0)