Skip to content

Commit

Permalink
Merge pull request #13539 from vbotbuildovich/backport-pr-13473-v23.2…
Browse files Browse the repository at this point in the history
….x-367

[v23.2.x] rpk: improved err msg in rpk tune --output-script
  • Loading branch information
twmb authored Sep 19, 2023
2 parents 92597d9 + 893e32e commit 9963ffc
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 9963ffc

Please sign in to comment.