Skip to content

Conversation

@Piskoo
Copy link
Collaborator

@Piskoo Piskoo commented Dec 4, 2025

Fixes an issue where chainloop config reset and other config management commands would fail when certificates couldn't be loaded, creating situation where users couldn't fix broken configurations.

Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
@Piskoo Piskoo marked this pull request as ready for review December 4, 2025 07:36
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>

// 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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming this will not fail if the annotation is not set correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct

cmd := &cobra.Command{
Use: "reset",
Short: "Reset the CLI configuration",
Annotations: map[string]string{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this affect all the config commands? Otherwise if it's failing you'll not be able to set it again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jiparis jiparis merged commit c00b1a5 into chainloop-dev:main Dec 5, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants