Only use persistent flags if appropriate #5423
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
These flags are used for shared functionality based on Cobra's "persistent" functions. In k0s, however, the distinction was never that clear. Persistent flags were mostly used by accident, sometimes to share flag definitions between subcommands, even if the persistent functions didn't use those flags.
Identify most (all?) of these cases and use flags instead of persistent flags. Deprecate and hide the unused persistent flags, so that they can eventually be removed.
Also remove the cwd prefixing for the restored config file in
k0s restore
. Relative paths are automatically resolved based on the current working directory. No need to do this manually.Type of change
How Has This Been Tested?
Checklist: