forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpk: make move-cancel available and hide movement-cancel
Originally 'movement-cancel' is used to cancel ongoing partition movements. This commit adds 'move-cancel' to align with the wording while it provide the same functionality and hides 'movement-cancel'.
- Loading branch information
Showing
3 changed files
with
93 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package partitions | ||
|
||
import ( | ||
"github.com/redpanda-data/redpanda/src/go/rpk/pkg/config" | ||
"github.com/spf13/afero" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func newMovementCancelCommandHidden(fs afero.Fs, p *config.Params) *cobra.Command { | ||
m := &movementCancelHandler{ | ||
fs: fs, | ||
p: p, | ||
} | ||
cmd := &cobra.Command{ | ||
Use: "movement-cancel", | ||
Short: "Cancel ongoing partition movements", | ||
Hidden: true, | ||
Long: `Cancel ongoing partition movements. | ||
By default, this command cancels all the partition movements in the cluster. | ||
To ensure that you do not accidentally cancel all partition movements, this | ||
command prompts users for confirmation before issuing the cancellation request. | ||
You can use "--no-confirm" to disable the confirmation prompt: | ||
rpk cluster partitions movement-cancel --no-confirm | ||
If "--node" is set, this command will only stop the partition movements | ||
occurring in the specified node: | ||
rpk cluster partitions movement-cancel --node 1 | ||
`, | ||
Args: cobra.ExactArgs(0), | ||
Run: m.runMovementCancel, | ||
} | ||
cmd.Flags().IntVar(&m.node, "node", -1, "ID of a specific node on which to cancel ongoing partition movements") | ||
cmd.Flags().BoolVar(&m.noConfirm, "no-confirm", false, "Disable confirmation prompt") | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters