Skip to content

Issue #59: DNS-1123-safe pod names + ContainerOrchestrationException wrapping in CreateContainerAsync - #60

Merged
larsbuch merged 1 commit into
mainfrom
vibe/podname-dns1123-293624
Nov 29, 2026
Merged

larsbuch merged 1 commit into
mainfrom
vibe/podname-dns1123-293624

Conversation

@larsbuch

Copy link
Copy Markdown
Contributor

Summary

Completes the fix for #59 on top of the already-merged length guard from #58 (v2.1.21):

  • GeneratePodName now sanitizes the crpcf.plugin-name label to a DNS-1123 subdomain (lowercase alphanumerics, -, .; invalid characters become -; empty result falls back to plugin) and caps the sanitized prefix at 30 chars so the 32-char GUID suffix always fits the 63-char pod-name limit — the [..63] range can never throw again, and any plugin name yields a valid pod name.
  • CreateContainerAsync runs pod-name/pod-definition generation inside its try block, so spec failures surface as ContainerOrchestrationException with the raw exception preserved as InnerException (previously a raw ArgumentOutOfRangeException escaped unwrapped). ContainerOrchestrationExceptions from the wait phase are rethrown as-is, not double-wrapped.
  • Unit tests pin: short plugin name (demo), >63-char name (capped, still valid), invalid chars (Harness_Web!! x → plugin-harness-web...), absent label (default plugin- prefix), and the exception wrapping (Labels = null → ContainerOrchestrationException with InnerException).
  • CHANGELOG + CRPCF_DEPLOYMENT_GUIDE §8.3 updated (pod-name format and wrapping contract).

The live-cluster acceptance (k8s-testkit suite 11 case A turning PASS) is covered by the existing KubernetesLiveContractTests (short labels live-exec/live-batch, which failed pre-fix) run with CRPCF_K8S_LIVE_TESTS=1.

Verification

  • CI (pr-validation.yml + dotnet-cicd.yml on the PR): build, both test projects, warning grep — watched until green.
  • New hermetic tests run in CI; live tests self-skip without CRPCF_K8S_LIVE_TESTS=1.

Closes #59

…nd wrap spec failures as ContainerOrchestrationException

- GeneratePodName now sanitizes the crpcf.plugin-name label to a DNS-1123
  subdomain (lowercase alphanumerics, '-', '.'; invalid chars become '-') and
  caps the prefix at 30 chars so the 32-char GUID suffix always fits the
  63-char pod-name limit - the [..63] range never throws anymore
- CreateContainerAsync runs name/pod-definition generation inside its try so
  spec failures surface as ContainerOrchestrationException (raw exception as
  InnerException) instead of escaping unwrapped
- Unit tests pin short / >63-char / invalid-char / absent plugin-name labels
  and the exception wrapping; CHANGELOG + deployment guide updated

Co-authored-by: larsbuch <larsbuch@users.noreply.github.com>
@larsbuch
larsbuch marked this pull request as ready for review November 29, 2026 13:17
@larsbuch
larsbuch merged commit 3faa1dd into main Nov 29, 2026
11 checks passed
@larsbuch
larsbuch deleted the vibe/podname-dns1123-293624 branch November 29, 2026 13:17
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.

Containerized.Kubernetes: CreateContainerAsync always throws ArgumentOutOfRangeException - GeneratePodName's [..63] range does not truncate

2 participants