init: add trustee-ca-cert flag - #57
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a non-interactive way to set the Trustee CA certificate path during cococtl init, so generated config can be used by initdata-related flows without requiring interactive prompts.
Changes:
- Add
--trustee-ca-certflag toinitand persist it intocfg.TrusteeCACert. - Add unit tests covering presence/absence of the new flag.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cmd/init.go | Introduces --trustee-ca-cert and wires it into generated config. |
| cmd/init_test.go | Adds tests asserting TrusteeCACert is persisted when the flag is set/cleared. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This flag allows the user also when not in interactive mode to add the trustee certs, which are essential for initdata. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Replace shared initCmd usage in tests with a newTestInitCmd() helper that creates a fresh cobra.Command per test, preventing flag state from leaking across tests. Also add tests for --trustee-ca-cert flag and fix a missing function declaration in TestInitCommand_WithoutTrusteeCACertFlag. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
bpradipt
approved these changes
Jul 14, 2026
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.
This flag allows the user also when not in interactive mode to add the trustee certs, which are essential for initdata.