Skip to content

Commit 510e829

Browse files
authored
cmd: Use force flag with instance override (#113)
Fixes a bug where the usage of a --force flag was missing from the "elasticsearch instance override" command
1 parent 3c20f53 commit 510e829

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/deployment/elasticsearch/instances/override.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ Set the cluster instance to 3x of its current capacity:
6868
storageMultiplier, _ := cmd.Flags().GetUint8("storage-multiplier")
6969
value, _ := cmd.Flags().GetUint16("value")
7070
reset, _ := cmd.Flags().GetBool("reset")
71+
force, _ := cmd.Flags().GetBool("force")
7172

7273
if multiplier > 0 || value > 0 || reset {
73-
if !cmdutil.ConfirmAction(
74-
"WARNING: changing instance capacity incurs a rolling restart, do you want to continue? [n/y]: ",
75-
os.Stdin,
76-
os.Stdout,
77-
) {
74+
msg := "WARNING: changing instance capacity incurs a rolling restart, do you want to continue? [n/y]: "
75+
if !force && !cmdutil.ConfirmAction(msg, os.Stdin, os.Stdout) {
7876
return nil
7977
}
8078
}

0 commit comments

Comments
 (0)