Skip to content

feat(oabctl): wire k8s secret refs into K8sDriver (slice 3d) - #100

Open
brettchien wants to merge 1 commit into
feat/k8s-driver-slice3b-k8sdriver-skeletonfrom
feat/k8s-driver-slice3d-secrets
Open

feat(oabctl): wire k8s secret refs into K8sDriver (slice 3d)#100
brettchien wants to merge 1 commit into
feat/k8s-driver-slice3b-k8sdriver-skeletonfrom
feat/k8s-driver-slice3d-secrets

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Summary

Sub-slice 3d of #97 (K8s driver — ADR #63 slice 3): k8s secret refs, wired into K8sDriver.

  • secrets::parse_k8s_secret_uri("k8s-secret://<secret-name>#<key>") — pure parsing, no API call (unlike aws-sm://, which resolves a logical secret-id to an ARN via DescribeSecret; a k8s Secret is referenced by name+key directly, kubelet resolves it at pod-start).
  • K8sDriver::build_deployment now emits env[].valueFrom.secretKeyRef for each spec.secrets entry, instead of the placeholder bail from feat(oabctl): K8sDriver skeleton — apply/scale/delete against a Deployment (slice 3b) #99.
  • Any value using a different scheme (an ECS aws-sm:// ref or raw ARN — e.g. copy-pasted from an ECS manifest) fails loudly at apply time with a clear message, rather than being silently ignored or mis-deployed.
  • The k8s Secret object itself must already exist in the target namespace — creating it is explicitly out of scope here, same non-creating shape aws-sm:// already has for ECS (it references a secret Secrets Manager already holds, never creates one). Who/what creates the Secret is create.rs-wizard-adjacent territory, tracked separately (already flagged as open in K8s driver (ADR #63 slice 3) — sub-slice tracking #97's 3a notes).

reject_unsupported() now only guards spec.bundleFrom (3c, still open) — secrets are no longer on that list.

Stacking note

Branched from #99 (3b). Diff will narrow once #98#99→this land in order.

Testing

cargo test -p oabctl (98/98, 6 new) + cargo clippy -p oabctl --all-targets -- -D warnings — clean, CARGO_PROFILE_DEV_DEBUG=0 as usual on this box.

Ref #97.

spec.secrets values for a k8s-runtime manifest must now be
k8s-secret://<secret-name>#<key> — parsed in secrets.rs (pure, no API call:
unlike aws-sm://, a k8s Secret is referenced by name+key directly, kubelet
resolves it at pod-start time) and wired into build_deployment as
env[].valueFrom.secretKeyRef. Any other scheme (an ECS aws-sm:// ref or raw
ARN left over from copy-pasting an ECS manifest) fails loudly at apply time
instead of silently mis-deploying — same "declare the contract, fail closed
on mismatch" shape the rest of this driver already uses.

The Secret object itself must already exist in the target namespace —
creating it is a separate concern, deliberately out of scope here (mirrors
aws-sm://, which likewise only *references* a secret Secrets Manager already
holds, never creates one).

reject_unsupported() now only guards spec.bundleFrom (3c, still open) —
secrets are no longer in that list.

6 new tests (2 in secrets.rs for the parser, 4 in k8s_driver.rs), 98/98
total green, clippy -D warnings clean.

Ref: studio#97 (K8s driver — ADR #63 slice 3, sub-slice tracking)
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