Skip to content

New improvements#23

Closed
esposem wants to merge 7 commits intoconfidential-devhub:mainfrom
esposem:new_improvements
Closed

New improvements#23
esposem wants to merge 7 commits intoconfidential-devhub:mainfrom
esposem:new_improvements

Conversation

@esposem
Copy link

@esposem esposem commented Feb 13, 2026

Make kubectl optional, and don't upload anything to Trustee.

Major changes include:

  • kubectl is used to try and figure cluster ips, runtimeclass and so on. If missing, nothing happens
  • init:
    -- trustee-url to set the default Trustee URL, only needed by initdata
    -- no-certs to avoid generating certs for the sidecar and use exsting ones
    -- cert-dir to decide where to store the generated certs
  • apply:
    -- target-namespace to define what is the target namespace of the new manifests. Priority is 1. original ns in manifest, 2. current namespace, 3. "default"
    -- enable-initdata to generate initdata annotation
    -- trustee-url to override default trustee-url provided with init
    -- cert-dir to override default cert-dir provided with init

esposem and others added 2 commits February 16, 2026 11:46
- Replace Sidecar.Enabled boolean with NoCerts to better reflect intent
- Add CertDir field to specify custom certificate directory
- Remove KBSImage field (no longer needed for Trustee deployment)
- Update validation to ensure CertDir is set when NoCerts is false
- Change GetTrusteeNamespace to return DefaultTrusteeNamespace when URL is empty
- Make TrusteeServer optional in config (only needed for initdata generation)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove --skip-trustee-deploy flag (no longer auto-deploying Trustee)
- Remove --trustee-namespace flag (not needed without deployment)
- Update --trustee-url description to clarify it's only needed for initdata generation
- Refactor handleTrusteeSetup to simply prompt for URL without deployment logic
- Remove trustee package import (no longer needed)
- Simplify runInit validation and error handling

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
esposem and others added 5 commits February 16, 2026 13:07
Flag changes:
- Add --trustee-url flag (with fallback to config)
- Add --target-namespace flag for explicit namespace control
- Replace --skip-apply with --enable-initdata (inverted logic, defaults to true)
- Add --cert-dir flag for custom sidecar certificate directory
- Move --config flag to top of flag definitions for better organization
- Update flag descriptions to clarify defaults

Behavioral changes:
- Remove automatic kubectl apply (now only generates manifests)
- Remove automatic Trustee upload for secrets and imagePullSecrets
- Update sidecar certificate handling to use --cert-dir
- Add getManifestNamespace() helper to consolidate namespace resolution logic
- Update transformManifest() signature (remove skipApply parameter)
- Change "Backup saved" message to "CoCo-ified manifest saved"
- Remove Sidecar.Enabled checks (sidecar is now controlled only by --sidecar flag)
- Add validation for --cert-dir vs --no-certs config setting

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- DetectSecrets() and DetectImagePullSecretsWithServiceAccount() now take namespace parameter
- Remove GetCurrentNamespace() function (namespace resolution moved to caller)
- ConvertToSealed() now takes both kbsNamespace and k8sNamespace parameters
  - kbsNamespace: used in KBS URI (always "default" for consistency)
  - k8sNamespace: used for K8s resource namespace (from input manifest)
- GenerateSealedSecretsYAML() now takes namespace parameter
- Refactor GenerateSealedSecretYAML() to use yaml.Marshal instead of kubectl
- Update error handling to be warnings instead of hard failures for:
  - Failed kubectl secret inspection (secrets still work, just not fully converted)
  - Failed imagePullSecret handling (allows workflow to continue)
- Update tests to reflect new namespace handling
- Remove "Note: Automatic Trustee upload failed" message (Trustee upload no longer automatic)

This centralizes namespace resolution in the caller (apply.go) and makes the
secrets package more explicit about which namespace is used where.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add trusteeURL parameter to Generate() function
- Validate that trusteeURL is not empty before generating initdata
- This makes the Trustee URL requirement explicit at the API level
  rather than relying on config validation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove cfg.Sidecar.Enabled checks from Inject() and GenerateService()
- Sidecar injection is now controlled solely by caller (--sidecar flag in apply.go)
- This simplifies the sidecar package by removing conditional logic
- Caller is responsible for deciding whether to inject sidecar

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove Sidecar.Enabled field from default config
- Update DetectSecrets() call to pass namespace parameter
- Update sidecar check to only use enableSidecar flag (remove cfg.Sidecar.Enabled check)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@esposem
Copy link
Author

esposem commented Feb 18, 2026

Closed in favor of #24

@esposem esposem deleted the new_improvements branch February 18, 2026 08:34
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.

1 participant