Skip to content

Dump initdata#21

Merged
bpradipt merged 2 commits intoconfidential-devhub:mainfrom
bpradipt:dump-initdata-pr
Feb 7, 2026
Merged

Dump initdata#21
bpradipt merged 2 commits intoconfidential-devhub:mainfrom
bpradipt:dump-initdata-pr

Conversation

@bpradipt
Copy link
Contributor

@bpradipt bpradipt commented Feb 6, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a new dump-initdata command to the kubectl-coco CLI tool that allows users to inspect and debug the generated initdata configuration for Confidential Containers (CoCo). The command can output either human-readable decoded contents (default) or the raw base64-encoded annotation value (with --raw flag).

Changes:

  • Added dump-initdata command to display aa.toml, cdh.toml, and policy.rego contents
  • Implemented decoding logic to extract and display initdata components
  • Added comprehensive test coverage for the new command including valid/invalid config handling and raw output mode

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

File Description
cmd/dump_initdata.go Implements the dump-initdata command with functions to generate, decode, and display initdata in both human-readable and raw formats
cmd/dump_initdata_test.go Provides test coverage for the new command including tests for valid configs, raw mode, missing/invalid configs, and the decode helper function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add new cobra command for inspecting generated initdata
- Support --config flag for alternate config file path
- Support --raw flag for base64-encoded annotation output
- Default output shows decoded aa.toml, cdh.toml, policy.rego
- Register command in root command tree

Assisted-by: AI
Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
- TestDumpInitdataWithValidConfig: verifies decoded output with valid config
- TestDumpInitdataWithRawFlag: verifies base64-encoded output with --raw
- TestDumpInitdataMissingConfig: verifies error handling for missing config
- TestDumpInitdataInvalidConfig: verifies error handling for malformed TOML
- TestDecodeInitdata: verifies the decode helper function

Assisted-by: AI
Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bpradipt bpradipt merged commit b6d735f into confidential-devhub:main Feb 7, 2026
9 checks passed
@bpradipt bpradipt deleted the dump-initdata-pr branch February 7, 2026 07:10
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.

2 participants