fix(config): allow commands to run without valid connection#2596
Merged
jiparis merged 2 commits intochainloop-dev:mainfrom Dec 5, 2025
Merged
fix(config): allow commands to run without valid connection#2596jiparis merged 2 commits intochainloop-dev:mainfrom
jiparis merged 2 commits intochainloop-dev:mainfrom
Conversation
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
migmartri
reviewed
Dec 4, 2025
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
migmartri
approved these changes
Dec 4, 2025
|
|
||
| // Commands annotated with skipActionOptsInit don't need ActionOpts initialization | ||
| // These are local-only commands that don't interact with the control plane | ||
| if cmd.Annotations[skipActionOptsInit] == trueString { |
Member
There was a problem hiding this comment.
I am assuming this will not fail if the annotation is not set correct?
migmartri
reviewed
Dec 4, 2025
| cmd := &cobra.Command{ | ||
| Use: "reset", | ||
| Short: "Reset the CLI configuration", | ||
| Annotations: map[string]string{ |
Member
There was a problem hiding this comment.
shouldn't this affect all the config commands? Otherwise if it's failing you'll not be able to set it again?
Collaborator
Author
There was a problem hiding this comment.
It does affect all of them, but I've excluded config plugin because it uses some of the fields that actionopts contain. Subcommands don't inherit annotations from parents so it has to be added to each command.
This file contains hidden or 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
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.
Fixes an issue where
chainloop config resetand other config management commands would fail when certificates couldn't be loaded, creating situation where users couldn't fix broken configurations.