fix(kubernetes): consolidate namespace label management to ensure lfc/uuid is always present#131
Merged
vigneshrajsb merged 3 commits intomainfrom Mar 12, 2026
Merged
Conversation
…e-deploy Static environments that were originally created with TTL enabled would never get their lfc/ttl-enable label corrected on subsequent deploys because the else branch skipped any namespace update. Now, when a namespace already exists and staticEnv=true, we explicitly patch lfc/ttl-enable to 'false' to ensure the label reflects the current static state regardless of how the namespace was first created. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…notations to lfc/* - Simplify ensureNamespaceExists labels in nativeBuild/utils.ts - Rename lifecycle.io/* annotations to lfc/* in utils.ts and jobFactory.ts - Update generateTTLLabels and generateTTLPatch to include lfc/uuid, lfc/type, and app.kubernetes.io/managed-by - Consolidate createOrUpdateNamespace PATCH branches in kubernetes.ts - Add UUID fallback derivation from namespace name in ttlCleanup.ts - Update annotation assertions in buildkit.test.ts and utils.test.ts to match lfc/* Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vmelikyan
approved these changes
Mar 12, 2026
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
ensureNamespaceExists(build phase) created namespaces withoutlfc/uuid, and the deploy-phase PATCH only updatedlfc/ttl-*labels, never addinglfc/uuid. TTL cleanup silently skipped namespaces missinglfc/uuid.ensureNamespaceExiststo use onlyapp.kubernetes.io/managed-byas a minimal identifier; all lifecycle-specific labels are now set exclusively bycreateOrUpdateNamespacegenerateTTLLabelsto includelfc/uuid,lfc/type, andapp.kubernetes.io/managed-byin all new namespace creationsgenerateTTLPatchto prepend base patch ops (lfc/uuid,lfc/type,app.kubernetes.io/managed-by) so re-deploys always upsert these labels onto existing namespacescreateOrUpdateNamespace(static and non-static) into a singlegenerateTTLPatchcalllfc/uuidderive it from the namespace name (env-<uuid>) instead of being silently skipped foreverlifecycle.io/*annotations tolfc/*for consistency (dockerfile,ecr-repo,triggered-at)Test plan
lfc/uuid,lfc/type: ephemeral,lfc/ttl-enable: true,lfc/ttl-expireAt*,app.kubernetes.io/managed-by: lifecyclelfc/uuidis patched onto itlfc/type: staticandlfc/ttl-enable: falselfc/uuidandlfc/ttl-enable: falseare patched🤖 Generated with Claude Code