Conversation
Containers and networks created by crossplane render carried no labels, so leftovers (after a crash, kill -9, CI timeout, or deliberate Orphan / named-container reuse) could not be reliably identified or swept. Label Function containers, the crossplane internal render engine container, and the temporary render network with render.crossplane.io/managed-by=crossplane. Function containers also record their effective cleanup policy in render.crossplane.io/cleanup. Refs crossplane#401 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.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.
Description of your changes
Docker resources created by
crossplane rendercarried no labels, so leftovers (afterkill -9, crashes, CI timeouts, or deliberateOrphan/runtime-docker-namereuse) could not be reliably identified or swept.This PR adds labels, purely additively:
render.crossplane.io/managed-by: crossplaneon Function containers, thecrossplane internal renderengine container, and the temporarycrossplane-render-*network.render.crossplane.io/cleanup: <Stop|Remove|Orphan>on Function containers, recording the effective cleanup policy.Label keys are exported constants (
LabelKeyManagedBy,LabelValueManagedByCrossplane,LabelKeyCleanup) next to the existing annotation constants. A newdocker.RunWithLabelsoption plumbs labels intodocker.RunContainer. No exported signatures change.Note: a pre-existing named container (
runtime-docker-name) that gets reused is not relabeled, because Docker can't change labels on an existing container. It only gets labels if render creates it.Tests: unit tests for
functionContainerLabelsandRunWithLabels.createContainer/createRenderNetworktalk to a real Docker client, so they aren't unit tested directly.Follow-ups (not in this PR):
render.crossplane.io/sessionID label to scope cleanup to one run.Fixes #401
I have:
Run(nix isn't installed; I ran./nix.sh flake checkto ensure this PR is ready for review.go build ./...,go test ./cmd/crossplane/render/... ./internal/..., andgolangci-lint runon the touched packages instead)Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.
🤖 Generated with Claude Code