Skip to content

Immutable secrets and consumer finalizers for TransportURL credential rotation#606

Closed
lmiccini wants to merge 2 commits into
openstack-k8s-operators:mainfrom
lmiccini:immutable-transport-secrets
Closed

Immutable secrets and consumer finalizers for TransportURL credential rotation#606
lmiccini wants to merge 2 commits into
openstack-k8s-operators:mainfrom
lmiccini:immutable-transport-secrets

Conversation

@lmiccini

Copy link
Copy Markdown
Contributor

During credential rotation, create a new immutable secret instead of patching the existing mutable one. Consuming service operators add a consumer finalizer to the new secret and remove it from the old one after completing their rollout. The TransportURL controller waits for all consumer finalizers to be removed before deleting the old secret and releasing the old RabbitMQ user.

This follows the Keystone Application Credentials pattern already established across the ecosystem and eliminates the need for cross-operator unstructured lookups (17-API-group RBAC removed).

Backward compatible: if no consumer finalizer is present on the old secret (pre-upgrade operator), the old user is released immediately.

EDPM path unchanged: continues using NodeSet hash-sync gating.

@openshift-ci openshift-ci Bot requested review from abays and dciabrin June 16, 2026 09:00
@openshift-ci

openshift-ci Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmiccini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

… rotation

Implement safe credential rotation for TransportURL by creating immutable
secrets with content-hashed names, adding per-consumer finalizers to
coordinate lifecycle between TransportURL and RabbitMQUser CRs, and
gating old user release on both consumer finalizer removal and NodeSet
secret hash synchronization.

Key changes:
- Create immutable transport secrets (rabbitmq-transport-url-{name}-{hash})
  during rotation to prevent content mutation by consumers
- Add per-consumer finalizers (turl.openstack.org/t-{name}) on shared
  RabbitMQUser and RabbitMQVhost CRs to track active consumers
- Add transport secret consumer finalizer protocol for consuming operators
  to signal rollout completion
- Unified release path: wait for consumer finalizer removal, then check
  NodeSet secret hash sync — if hashes are in sync the secret is not
  tracked by the dataplane and the old user is released immediately;
  if out of sync, wait for full NodeSet deployment to complete
- Prevent SecretName flip-flop by comparing content hashes before
  deciding whether to create a new immutable secret
- Auto-delete orphaned RabbitMQUser CRs when all consumers release
  their finalizers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lmiccini lmiccini force-pushed the immutable-transport-secrets branch from d965307 to 650554b Compare June 17, 2026 12:52
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/924304fa77aa467ea0514d0d32d32d2d

✔️ openstack-k8s-operators-content-provider SUCCESS in 20m 58s
podified-multinode-edpm-deployment-crc NODE_FAILURE Node(set) request 099-0000122238 failed in 0s
cifmw-crc-podified-edpm-baremetal NODE_FAILURE Node(set) request 099-0000122239 failed in 0s

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

Extracts the transport secret rotation guard boilerplate that every
operator duplicates (~15 lines per transport URL) into a single
reusable function. The caller passes its own guard condition; the
helper handles rotation detection, finalizer removal, and status
value management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lmiccini lmiccini closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant