Skip to content

Commit 60f6289

Browse files
committed
refac(printer) remove AssumeYes checks - trivial cases
1 parent b3088b0 commit 60f6289

File tree

228 files changed

+939
-1395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+939
-1395
lines changed

internal/cmd/affinity-groups/create/create.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5454
return err
5555
}
5656

57-
if !model.AssumeYes {
58-
prompt := fmt.Sprintf("Are you sure you want to create the affinity group %q?", model.Name)
59-
err = params.Printer.PromptForConfirmation(prompt)
60-
if err != nil {
61-
return err
62-
}
57+
prompt := fmt.Sprintf("Are you sure you want to create the affinity group %q?", model.Name)
58+
err = params.Printer.PromptForConfirmation(prompt)
59+
if err != nil {
60+
return err
6361
}
6462

6563
// Call API

internal/cmd/affinity-groups/delete/delete.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6565
affinityGroupLabel = model.AffinityGroupId
6666
}
6767

68-
if !model.AssumeYes {
69-
prompt := fmt.Sprintf("Are you sure you want to delete affinity group %q?", affinityGroupLabel)
70-
err = params.Printer.PromptForConfirmation(prompt)
71-
if err != nil {
72-
return err
73-
}
68+
prompt := fmt.Sprintf("Are you sure you want to delete affinity group %q?", affinityGroupLabel)
69+
err = params.Printer.PromptForConfirmation(prompt)
70+
if err != nil {
71+
return err
7472
}
7573

7674
// Call API

internal/cmd/beta/alb/create/create.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6666
projectLabel = model.ProjectId
6767
}
6868

69-
if !model.AssumeYes {
70-
prompt := fmt.Sprintf("Are you sure you want to create an application loadbalancer for project %q?", projectLabel)
71-
err = params.Printer.PromptForConfirmation(prompt)
72-
if err != nil {
73-
return err
74-
}
69+
prompt := fmt.Sprintf("Are you sure you want to create an application loadbalancer for project %q?", projectLabel)
70+
err = params.Printer.PromptForConfirmation(prompt)
71+
if err != nil {
72+
return err
7573
}
7674

7775
// Call API

internal/cmd/beta/alb/delete/delete.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5757
projectLabel = model.ProjectId
5858
}
5959

60-
if !model.AssumeYes {
61-
prompt := fmt.Sprintf("Are you sure you want to delete the application loadbalancer %q for project %q?", model.Name, projectLabel)
62-
err = params.Printer.PromptForConfirmation(prompt)
63-
if err != nil {
64-
return err
65-
}
60+
prompt := fmt.Sprintf("Are you sure you want to delete the application loadbalancer %q for project %q?", model.Name, projectLabel)
61+
err = params.Printer.PromptForConfirmation(prompt)
62+
if err != nil {
63+
return err
6664
}
6765

6866
// Call API

internal/cmd/beta/alb/observability-credentials/add/add.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5555
return err
5656
}
5757

58-
if !model.AssumeYes {
59-
prompt := "Are your sure you want to add credentials?"
60-
err = params.Printer.PromptForConfirmation(prompt)
61-
if err != nil {
62-
return err
63-
}
58+
prompt := "Are your sure you want to add credentials?"
59+
err = params.Printer.PromptForConfirmation(prompt)
60+
if err != nil {
61+
return err
6462
}
6563

6664
// Call API

internal/cmd/beta/alb/observability-credentials/delete/delete.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
5050
return err
5151
}
5252

53-
if !model.AssumeYes {
54-
prompt := fmt.Sprintf("Are you sure you want to delete credentials %q?", model.CredentialsRef)
55-
err = params.Printer.PromptForConfirmation(prompt)
56-
if err != nil {
57-
return err
58-
}
53+
prompt := fmt.Sprintf("Are you sure you want to delete credentials %q?", model.CredentialsRef)
54+
err = params.Printer.PromptForConfirmation(prompt)
55+
if err != nil {
56+
return err
5957
}
6058

6159
// Call API

internal/cmd/beta/alb/observability-credentials/update/update.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6464
params.Printer.Debug(print.ErrorLevel, "get project name: %v", err)
6565
projectLabel = model.ProjectId
6666
}
67-
if !model.AssumeYes {
68-
prompt := fmt.Sprintf("Are you sure you want to update credential %q for %q?", *model.CredentialsRef, projectLabel)
69-
err = params.Printer.PromptForConfirmation(prompt)
70-
if err != nil {
71-
return fmt.Errorf("update credential: %w", err)
72-
}
67+
prompt := fmt.Sprintf("Are you sure you want to update credential %q for %q?", *model.CredentialsRef, projectLabel)
68+
err = params.Printer.PromptForConfirmation(prompt)
69+
if err != nil {
70+
return fmt.Errorf("update credential: %w", err)
7371
}
7472

7573
// Call API

internal/cmd/beta/alb/pool/update/update.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6666
projectLabel = model.ProjectId
6767
}
6868

69-
if !model.AssumeYes {
70-
prompt := fmt.Sprintf("Are you sure you want to update an application target pool for project %q?", projectLabel)
71-
err = params.Printer.PromptForConfirmation(prompt)
72-
if err != nil {
73-
return err
74-
}
69+
prompt := fmt.Sprintf("Are you sure you want to update an application target pool for project %q?", projectLabel)
70+
err = params.Printer.PromptForConfirmation(prompt)
71+
if err != nil {
72+
return err
7573
}
7674

7775
// Call API

internal/cmd/beta/alb/update/update.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6767
projectLabel = model.ProjectId
6868
}
6969

70-
if !model.AssumeYes {
71-
prompt := fmt.Sprintf("Are you sure you want to update an application loadbalancer for project %q?", projectLabel)
72-
err = params.Printer.PromptForConfirmation(prompt)
73-
if err != nil {
74-
return err
75-
}
70+
prompt := fmt.Sprintf("Are you sure you want to update an application loadbalancer for project %q?", projectLabel)
71+
err = params.Printer.PromptForConfirmation(prompt)
72+
if err != nil {
73+
return err
7674
}
7775

7876
// for updates of an existing ALB the current version must be passed to the request

internal/cmd/beta/intake/runner/create/create.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,10 @@ func NewCmd(p *types.CmdParams) *cobra.Command {
7373
projectLabel = model.ProjectId
7474
}
7575

76-
if !model.AssumeYes {
77-
prompt := fmt.Sprintf("Are you sure you want to create an Intake Runner for project %q?", projectLabel)
78-
err = p.Printer.PromptForConfirmation(prompt)
79-
if err != nil {
80-
return err
81-
}
76+
prompt := fmt.Sprintf("Are you sure you want to create an Intake Runner for project %q?", projectLabel)
77+
err = p.Printer.PromptForConfirmation(prompt)
78+
if err != nil {
79+
return err
8280
}
8381

8482
// Call API

0 commit comments

Comments
 (0)