feat(openstack-sync-operator): manage ironic runbooks using openstack-sync-operator - #2314
Merged
Merged
Conversation
1 task
haseebsyed12
force-pushed
the
openstack-sync-plugin-ironic-runbooks
branch
from
September 4, 2026 21:14
080f777 to
227ac8e
Compare
cardoe
reviewed
Sep 5, 2026
Contributor
There was a problem hiding this comment.
Overall this is a good clean up and improvement. Six inline comments. The two I'd like resolved before this merges are the CRD ownership handoff (data loss on upgrade) and the /owner patch (403 loop that parks every CR in Failed); the rest are smaller.
One thing that didn't fit inline because the files aren't in this diff — stale docs:
docs/operator-guide/baremetal-ironic-cleanup-runbook.md(around line 502) still points atrunbook-crdandrunbook-crd/samplesas where the CRD and samples live. Those paths still exist on disk after this PR but are no longer rendered by any kustomization, so anyone following the doc edits files that are never applied — the worst kind of stale, since it looks like it worked.docs/operator-guide/server-firmware-update.mdstill describes the legacy shell-operator hooks.
Both should move to components/openstack-sync-plugins/ironic-runbooks/examples/.
For the record, things I specifically checked that are fine:
- The
1.112microversion floor is right — that's where runbookdescriptionand the/runbooks/{id}/traitssub-resource land, and traits are correctly kept out of the create/patch bodies. - Step payload shape matches
RUNBOOK_STEP_SCHEMA. - The public-transition path is fine; Ironic nulls
owneritself when/publicis patched. Proxy.requestdefaults toraise_exc=False, so the explicitraise_from_responseandNotFoundExceptionhandling is doing real work, not dead code.- Narrowing
prune_credentialsfrom_credentials(desired)to_credentials(changed)inframework.pyreads as a deliberate tightening and is safe.
All 263 existing tests pass on the branch.
Generated by Claude Code
haseebsyed12
force-pushed
the
openstack-sync-plugin-ironic-runbooks
branch
from
September 7, 2026 10:34
227ac8e to
ed30c35
Compare
haseebsyed12
force-pushed
the
openstack-sync-plugin-ironic-runbooks
branch
from
September 7, 2026 18:57
ed30c35 to
b78eed6
Compare
A project-scoped create is assigned the caller's own project, so a CR that names no owner reads one back on every reconcile after the first. Patching /owner is gated on baremetal:runbook:update:owner (SYSTEM_MEMBER), so the operator was emitting a 403 on the second pass of every runbook created with a project-scoped credential, parking the CR in Failed and skipping prune. An unset spec.owner now means "do not manage this field", which is the reading the CRD already documented. Clearing an owner is still possible by setting public, which Ironic does itself. Also corrects what public promises. It governs visibility, not use: runbook:get falls back to the runbook being public and a project-scoped list filters on owner == project OR public, but runbook:use resolves the owner alone, so a public runbook is usable only by a system-scoped or role:service token. The CRD, schema, examples and the status note said it made the runbook usable by every project. Adds coverage for the credential-scope matrix: two reconciles against a fake that refuses /owner and /public the way the policy does, the public-to-owned transition Ironic only accepts atomically, and the two operations a project-scoped credential cannot perform at all.
haseebsyed12
force-pushed
the
openstack-sync-plugin-ironic-runbooks
branch
from
September 8, 2026 18:48
9ba20a6 to
42618e7
Compare
cardoe
approved these changes
Sep 8, 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.
Introduces declarative Ironic runbook management through OpenStack Sync.
Sites can now define runbooks as Kubernetes CRs, keep them in the deployment repo, and let the operator converge Ironic state from Git. That makes runbook ownership, updates, pruning, and status reporting part of the same GitOps workflow used for other OpenStack sync resources.
The design keeps shared framework code limited to generic sync mechanics: binding-context handling, credential grouping, status updates, pruning orchestration, and reusable OpenStack pagination. Ironic-specific behavior stays in the runbook plugin, including API microversion requirements, trait matching, owner/public handling, and runbook deletion rules.
What does this change do?
Upgrade impact
upgrade-impactlabel and a release note: runscriv createfrom therepository root and describe the required action in the generated
changelog.d/file. See RELEASING.md.Operator action means anything a deployment has to do beyond a normal resync:
deploy repo or values changes, new or removed secrets, enabling or disabling a
component, or a manual one-time step.