Skip to content

Commit

Permalink
fix -f flag for etcd alarm list / disarm commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed May 20, 2024
1 parent d752a63 commit 7b3fe03
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 26 deletions.
63 changes: 37 additions & 26 deletions pkg/commands/imported_etcd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tools/import_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ func processFile(filename, cmdName string) {
}
}

if cmdName == "etcd" {
for _, subCmdName := range []string{"etcdAlarmListCmd", "etcdAlarmDisarmCmd"} {
initCode = fmt.Sprintf("%s\n%s", initCode, fmt.Sprintf(`
%s.Flags().StringSliceVarP(&etcdCmdFlags.configFiles, "file", "f", nil, "specify config files or patches in a YAML file (can specify multiple)")
%s.PreRunE = etcdCmd.PreRunE
`, subCmdName, subCmdName))
}
}

insertInitCode(node, cmdName, initCode)

var buf bytes.Buffer
Expand Down

0 comments on commit 7b3fe03

Please sign in to comment.