feat(scenarios): ConfigMap ownerReference + Workflow name templating (PR 7)#290
Merged
Merged
Conversation
…(PR 7)
Two related improvements to the major-upgrade scenario from PR 6:
1. Workflow CR's metadata.name now carries $SEI_WORKFLOW_RUN_ID so
concurrent applies don't collide on the CR. The previous hardcoded
`name: major-upgrade` meant two parallel `kubectl apply` invocations
would patch the same CR rather than create distinct runs, even when
the per-run ConfigMap names were distinct.
2. The workflow-vars-<run-id> ConfigMap now carries an ownerReference
pointing at the parent Workflow CR. Deletion of the Workflow cascades
garbage-collection of the ConfigMap automatically via
kube-controller-manager — no operator-managed cleanup, no leftover
ConfigMaps accumulating across runs.
Changes:
- scenarios/major-upgrade.yaml:
- Workflow.metadata.name = `major-upgrade-$SEI_WORKFLOW_RUN_ID`
- compute-target-height looks up the Workflow's UID via kubectl and
patches the rendered ConfigMap with ownerReferences before apply.
Uses `kubectl patch --local --type=merge` to inject the field at
the YAML pipeline stage (no need to re-Get after apply).
blockOwnerDeletion: false so the ConfigMap never blocks Workflow
deletion.
- runner/rbac.yaml: add `chaos-mesh.org/workflows: get` so
compute-target-height (running under the seitask-runner SA) can
resolve the parent Workflow's UID.
- scenarios/README.md: update the Cleanup and Known Limitations
sections to reflect the cascade-delete behavior and remove the
deferred-cleanup entry.
Runner binary unchanged. No new CRDs, no new templates, no Go code.
|
You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace. To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard. |
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.
Two related cleanups to the major-upgrade scenario from PR 6.
Workstream
Follow-up to the SeiNodeTask MVP workstream (design merged at #277):
.github/workflows/ecr.ymlChanges
1. Workflow CR name carries the run ID
Previously
metadata.name: major-upgradewas hardcoded. Two parallelkubectl applyinvocations would patch the same CR rather than create distinct runs, even when their ConfigMap names were distinct (the README's concurrent-runs claim only partially held).Now:
metadata.name: major-upgrade-$SEI_WORKFLOW_RUN_ID. Concurrent runs get genuinely separate Workflow CRs.2. ConfigMap ownerReference → Workflow CR
compute-target-heightnow looks up the parent Workflow's UID via kubectl and stamps it onto the rendered ConfigMap'sownerReferencesfield (viakubectl patch --local --type=merge) before applying.blockOwnerDeletion: falseso the ConfigMap never blocks Workflow deletion.Deletion of the Workflow now cascades garbage-collection of the ConfigMap automatically via kube-controller-manager. No operator-managed cleanup, no ConfigMap accumulation across runs.
3. RBAC
runner/rbac.yamlgains one new verb:chaos-mesh.org/workflows: get. The seitask-runner SA needs this socompute-target-heightcan resolve the parent Workflow's UID.4. README
kubectl delete workflow <name>removes the ConfigMap too.Test plan
yaml.safe_load_allparses bothscenarios/major-upgrade.yamlandrunner/rbac.yamlcleanlymetadata.namereflects$SEI_WORKFLOW_RUN_IDcompute-target-heightscript flow:kubectl get workflow → kubectl create configmap → kubectl label → kubectl patch (ownerRefs) → kubectl applykubectl patch --local --type=mergeownerReferences pattern works against an actual cluster (it's the cleanest YAML pipeline form; alternative is jq injection)blockOwnerDeletion: falseis the right call (we don't want stale ConfigMaps blocking Workflow cleanup)Runner binary unchanged. Only YAML + RBAC.
🤖 Generated with Claude Code