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

RFE: meaningful default name to save the preflights checks #825

Closed
camilamacedo86 opened this issue Nov 7, 2022 · 3 comments · Fixed by #834
Closed

RFE: meaningful default name to save the preflights checks #825

camilamacedo86 opened this issue Nov 7, 2022 · 3 comments · Fixed by #834
Assignees
Labels
good first issue Good for newcomers triaged

Comments

@camilamacedo86
Copy link
Contributor

Describe the rationale for the suggested feature.

After run kubectl preflight https://preflight.replicated.com and choose the s option to save the default output seems to be "o". Could we change that for for example preflight_checks.txt or preflight_checks_.txt?

Screenshot 2022-11-07 at 10 39 23

@diamonwiggins diamonwiggins added the good first issue Good for newcomers label Nov 9, 2022
@chris-sanders
Copy link
Member

lol, I think "o" is a pretty strange default surly we can do better than that.

@xavpaice
Copy link
Member

This appears to be the same for support-bundle - however in preflight, the help for the flag is in ./pkg/preflight/flags.go, and in support-bundle it's in ./cmd/troubleshoot/cli/root.go. I don't see at first look where the default is set for preflight.

Definition of done:

  • if -o is specified for either preflight or support-bundle, without supplying a filename, the output filename should be named preflight.tar.gz or support-bundle.tar.gz
  • if you run preflight or support-bundle interactively and opt to save the file, the output filename should be named preflight.tar.gz or support-bundle.tar.gz

@DexterYan DexterYan self-assigned this Nov 13, 2022
@DexterYan
Copy link
Member

DexterYan commented Nov 14, 2022

By looking at two previous PRs #769 and #538, seems the default logic was:

  • if -o is not specified for preflight, the output filename should be named
    <preflight name>-results-<date>.txt
  • if -o is specified for preflight, without supplying a filename, there will be an error which is
    Error: flag needs an argument: 'o' in -o
  • if -o is specified for preflight, with supplying a filename, the output filename should be the same as cli input

And for kubectl preflight https://preflight.replicated.com, the default output file name will be example-results-2022-11-14T14_54_14.txt

For the current issue, it is possible that we are not using the flags.StringVarP function to migrate the previous cmd.Flags().StringP("output", "o", "", "***"). I will make a pr for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants