Skip to content

Commit

Permalink
fix: do not ask service question if there is no service name (#6485)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Feb 24, 2023
1 parent 2a06689 commit 35cb794
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions cli/cdsctl/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,21 @@ func authConsumerNewRun(v cli.Values) error {
}

var svcType = v.GetString("service-type")
if svcType == "" && !v.GetBool("no-interactive") {
svcType = cli.AskValue("Service type")
}

var svcRegion = v.GetString("service-region")
if svcRegion == "" && !v.GetBool("no-interactive") {
svcRegion = cli.AskValue("Service region")
}

var svcIgnoreJobWithNoRegion = v.GetBool("service-ignore-job-with-no-region")
if !svcIgnoreJobWithNoRegion && !v.GetBool("no-interactive") {
svcIgnoreJobWithNoRegion = cli.AskConfirm("Service ignore job with no region")

if svcName != "" {
if svcType == "" && !v.GetBool("no-interactive") {
svcType = cli.AskValue("Service type")
}

if svcRegion == "" && !v.GetBool("no-interactive") {
svcRegion = cli.AskValue("Service region")
}

if !svcIgnoreJobWithNoRegion && !v.GetBool("no-interactive") {
svcIgnoreJobWithNoRegion = cli.AskConfirm("Service ignore job with no region")
}
}

var consumer = sdk.AuthUserConsumer{
Expand Down

0 comments on commit 35cb794

Please sign in to comment.