Repository navigation
Issue #59: DNS-1123-safe pod names + ContainerOrchestrationException wrapping in CreateContainerAsync - #60
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the fix for #59 on top of the already-merged length guard from #58 (v2.1.21):
GeneratePodNamenow sanitizes thecrpcf.plugin-namelabel to a DNS-1123 subdomain (lowercase alphanumerics,-,.; invalid characters become-; empty result falls back toplugin) 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.CreateContainerAsyncruns pod-name/pod-definition generation inside its try block, so spec failures surface asContainerOrchestrationExceptionwith the raw exception preserved asInnerException(previously a rawArgumentOutOfRangeExceptionescaped unwrapped).ContainerOrchestrationExceptions from the wait phase are rethrown as-is, not double-wrapped.demo), >63-char name (capped, still valid), invalid chars (Harness_Web!! x→plugin-harness-web...), absent label (defaultplugin-prefix), and the exception wrapping (Labels = null→ContainerOrchestrationExceptionwithInnerException).The live-cluster acceptance (k8s-testkit suite 11 case A turning PASS) is covered by the existing
KubernetesLiveContractTests(short labelslive-exec/live-batch, which failed pre-fix) run withCRPCF_K8S_LIVE_TESTS=1.Verification
pr-validation.yml+dotnet-cicd.ymlon the PR): build, both test projects, warning grep — watched until green.CRPCF_K8S_LIVE_TESTS=1.Closes #59