-
Notifications
You must be signed in to change notification settings - Fork 379
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
Encapsulate debug flag handling #5390
Draft
twz123
wants to merge
4
commits into
k0sproject:main
Choose a base branch
from
twz123:encapsulate-debug-flags
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request has merge conflicts that need to be resolved. |
twz123
force-pushed
the
encapsulate-debug-flags
branch
from
December 24, 2024 13:35
e90aef1
to
f7d165f
Compare
twz123
force-pushed
the
encapsulate-debug-flags
branch
from
December 24, 2024 13:54
f7d165f
to
e51ffd1
Compare
This pull request has merge conflicts that need to be resolved. |
twz123
force-pushed
the
encapsulate-debug-flags
branch
from
January 7, 2025 14:42
e51ffd1
to
b5c9e56
Compare
twz123
force-pushed
the
encapsulate-debug-flags
branch
from
January 7, 2025 16:06
b5c9e56
to
f5c848e
Compare
This pull request has merge conflicts that need to be resolved. |
twz123
force-pushed
the
encapsulate-debug-flags
branch
from
January 8, 2025 11:44
f5c848e
to
aeefa47
Compare
This pull request has merge conflicts that need to be resolved. |
Relative paths are automatically resolved based on the current working directory. No need to do this manually. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
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. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
Introduce internal.DebugFlags to replace debug and verbose logging flag handling. Move the flag definitions from the "PersistentFlagSet" to a struct method. Remove the debug flag handling from the root command and move it to the subcommands. This allows for the removal of CallPersistentPreRun, since the commands no longer rely on proper chaining of the PersistentPreRun hooks. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
twz123
force-pushed
the
encapsulate-debug-flags
branch
from
January 9, 2025 16:00
aeefa47
to
104340e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Introduce
internal.DebugFlags
to replace debug and verbose logging flag handling. Move the flag definitions from the "PersistentFlagSet" to a struct method. Remove the debug flag handling from the root command and move it to the sub-commands. This allows for the removal ofCallPersistentPreRun
, since the commands no longer rely on proper chaining of the PersistentPreRun hooks. Remove some redundant calls to the "PersistentFlagSet" in some sub-commands.Type of change
How Has This Been Tested?
Checklist: