Skip to content

init: add trustee-ca-cert flag - #57

Merged
bpradipt merged 2 commits into
confidential-devhub:mainfrom
esposem:init
Jul 14, 2026
Merged

bpradipt merged 2 commits into
confidential-devhub:mainfrom
esposem:init

Conversation

@esposem

@esposem esposem commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This flag allows the user also when not in interactive mode to add the trustee certs, which are essential for initdata.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-cert flag to init and persist it into cfg.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.

Comment thread cmd/init_test.go Outdated
Comment thread cmd/init_test.go Outdated
Comment thread cmd/init_test.go Outdated
esposem added 2 commits July 14, 2026 12:46
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
bpradipt merged commit f906cb3 into confidential-devhub:main Jul 14, 2026
3 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