Skip to content

feat(scenarios): ConfigMap ownerReference + Workflow name templating (PR 7)#290

Merged
bdchatham merged 1 commit into
mainfrom
feat/seinodetask-configmap-owner-ref
May 19, 2026
Merged

feat(scenarios): ConfigMap ownerReference + Workflow name templating (PR 7)#290
bdchatham merged 1 commit into
mainfrom
feat/seinodetask-configmap-owner-ref

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

@bdchatham bdchatham commented May 19, 2026

Two related cleanups to the major-upgrade scenario from PR 6.

Workstream

Follow-up to the SeiNodeTask MVP workstream (design merged at #277):

Changes

1. Workflow CR name carries the run ID

Previously metadata.name: major-upgrade was hardcoded. Two parallel kubectl apply invocations 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-height now looks up the parent Workflow's UID via kubectl and stamps it onto the rendered ConfigMap's ownerReferences field (via kubectl patch --local --type=merge) before applying. blockOwnerDeletion: false so 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.yaml gains one new verb: chaos-mesh.org/workflows: get. The seitask-runner SA needs this so compute-target-height can resolve the parent Workflow's UID.

4. README

Test plan

  • yaml.safe_load_all parses both scenarios/major-upgrade.yaml and runner/rbac.yaml cleanly
  • Workflow's metadata.name reflects $SEI_WORKFLOW_RUN_ID
  • compute-target-height script flow: kubectl get workflow → kubectl create configmap → kubectl label → kubectl patch (ownerRefs) → kubectl apply
  • Reviewers verify the kubectl patch --local --type=merge ownerReferences pattern works against an actual cluster (it's the cleanest YAML pipeline form; alternative is jq injection)
  • Reviewers confirm blockOwnerDeletion: false is the right call (we don't want stale ConfigMaps blocking Workflow cleanup)

Runner binary unchanged. Only YAML + RBAC.

🤖 Generated with Claude Code

…(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.
@cursor
Copy link
Copy Markdown

cursor Bot commented May 19, 2026

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.

@bdchatham bdchatham merged commit a170855 into main May 19, 2026
2 checks passed
@bdchatham bdchatham deleted the feat/seinodetask-configmap-owner-ref branch May 19, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant