render: label the Docker containers and networks render creates
维护者通常 3 天内回复
评估
调研方向
Start by tracing RuntimeDocker.createContainer, the Docker engine's render container creation, and createRenderNetwork. Read the existing cleanup-policy handling and follow how render sessions and networks are created and removed; done means every render-owned container and network carries consistent identifying labels without changing existing cleanup behavior.
由索引模型根据 Issue 内容生成。
描述
What problem are you facing?
There's no reliable way to tell which Docker containers and networks were created by crossplane render, so
anything it leaves behind can't be found and cleaned up afterwards.
Today the containers render creates carry only the image's own io.crossplane.xpkg:* label, unnamed
Function containers get random Docker names (suspicious_newton, distracted_mestorf, …), and the
crossplane internal render engine container and the crossplane-render-* network carry no labels at all.
Matching by image or name prefix is guesswork, and can catch containers the user started on purpose.
This matters because leftovers happen:
- Some interruptions can never be cleaned up in-process:
kill -9, a crash, an OOM kill, a CI job timeout.
Even with signal handling (#400), these leave resources behind. - Containers deliberately kept with
runtime-docker-cleanup: Orphanorruntime-docker-name(for warm
reuse across invocations) build up over time and can't be told apart from accidental leaks. - Tools built on the render library — for example
crossplane-diff, which renders many times per run —
have the same problem and currently have to track container names themselves.
How could Crossplane help solve your problem?
Add labels to every container and network render creates (in RuntimeDocker.createContainer, the docker
engine's render container, and createRenderNetwork). For example:
| Label | Value | Purpose |
|---|---|---|
render.crossplane.io/managed-by |
crossplane |
Identifies render-owned resources |
render.crossplane.io/session |
per-invocation ID | Scopes cleanup to one run |
render.crossplane.io/cleanup |
the effective cleanup policy (Remove, Stop, Orphan) |
Lets a sweep skip containers the user deliberately kept |
render.crossplane.io/created-by-pid (optional) |
PID | Helps detect leftovers from dead sessions |
That enables:
- A plain
docker ps -a --filter label=render.crossplane.io/managed-by=crossplanefor users. - Optionally, a small subcommand (e.g.
crossplane render cleanup [--all]) that removes leftovers from dead
sessions, skipping containers kept withOrphan/runtime-docker-nameunless--allis given. - Safer network cleanup: before removing a network, render could force-remove containers from its own
session that are still attached, without touching unrelated containers on a user-supplied
--crossplane-docker-network(see #398). - Library consumers could clean up by label and session ID instead of tracking container names themselves.
Adding labels is purely additive and doesn't change behaviour for existing users.
- 主要语言
- Go
- 星标
- 20
- 派生
- 34
- 平均合并
- 5 天 4 小时
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
crossplane/cli 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
crossplane/cli#432 ·
维护者通常 3 天内回复
-
`credsStore` in docker config causes unit test failures可能已有人在做 @sujeito-operator 于 58 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 84/100
crossplane/cli#282 ·
维护者通常 3 天内回复
-
Generated schemas go stale because each source writes into the shared tree on its own可能已有人在做 @stevendborrelli 于 1 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 18/100
crossplane/cli#428 ·
维护者通常 3 天内回复
-
nix.sh: fails immediately when run from a git worktree ("fatal: not a git repository")可能已有人在做 @boxcee-interview 于 2 天前认领。 未关闭bug
难度 3/5 半天 新手友好度 62/100
crossplane/cli#425 ·
维护者通常 3 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 35/100
crossplane/cli#424 ·
维护者通常 3 天内回复
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
superplanehq/superplane#8604 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
documentation hacktoberfest priority: low skill: good first issue status: ready for dev
难度 2/5 半天 新手友好度 85/100
hyperledger-labs/fabric-smart-client#2142 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
numberly/vault-db-injector#107 ·
维护者通常 1 天内回复