Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.2.x] rpk: improved err msg in rpk tune --output-script #13539

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/go/rpk/pkg/cli/redpanda/tune/tune.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ To learn more about a tuner, run 'rpk redpanda tune help <tuner name>'.
out.MaybeDie(err, "unable to load config: %v", err)
var tunerFactory factory.TunersFactory
if outTuneScriptFile != "" {
isDir, err := afero.IsDir(fs, outTuneScriptFile)
out.MaybeDie(err, "unable to check if %q is a dir or a file: %v", outTuneScriptFile, err)
if isDir {
out.Die("please use a filename instead of a directory name in --output-script")
}
tunerFactory = factory.NewScriptRenderingTunersFactory(fs, y.Rpk.Tuners, outTuneScriptFile, timeout)
} else {
tunerFactory = factory.NewDirectExecutorTunersFactory(fs, y.Rpk.Tuners, timeout)
Expand Down
Loading