Skip to content

Commit 35cb794

Browse files
authored
fix: do not ask service question if there is no service name (#6485)
1 parent 2a06689 commit 35cb794

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

cli/cdsctl/consumer.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,21 @@ func authConsumerNewRun(v cli.Values) error {
185185
}
186186

187187
var svcType = v.GetString("service-type")
188-
if svcType == "" && !v.GetBool("no-interactive") {
189-
svcType = cli.AskValue("Service type")
190-
}
191-
192188
var svcRegion = v.GetString("service-region")
193-
if svcRegion == "" && !v.GetBool("no-interactive") {
194-
svcRegion = cli.AskValue("Service region")
195-
}
196-
197189
var svcIgnoreJobWithNoRegion = v.GetBool("service-ignore-job-with-no-region")
198-
if !svcIgnoreJobWithNoRegion && !v.GetBool("no-interactive") {
199-
svcIgnoreJobWithNoRegion = cli.AskConfirm("Service ignore job with no region")
190+
191+
if svcName != "" {
192+
if svcType == "" && !v.GetBool("no-interactive") {
193+
svcType = cli.AskValue("Service type")
194+
}
195+
196+
if svcRegion == "" && !v.GetBool("no-interactive") {
197+
svcRegion = cli.AskValue("Service region")
198+
}
199+
200+
if !svcIgnoreJobWithNoRegion && !v.GetBool("no-interactive") {
201+
svcIgnoreJobWithNoRegion = cli.AskConfirm("Service ignore job with no region")
202+
}
200203
}
201204

202205
var consumer = sdk.AuthUserConsumer{

0 commit comments

Comments
 (0)