Skip to content

Immutable secrets and consumer finalizers for TransportURL credential rotation#608

Open
lmiccini wants to merge 3 commits into
openstack-k8s-operators:mainfrom
lmiccini:finalize-secret-rotation
Open

Immutable secrets and consumer finalizers for TransportURL credential rotation#608
lmiccini wants to merge 3 commits into
openstack-k8s-operators:mainfrom
lmiccini:finalize-secret-rotation

Conversation

@lmiccini

Copy link
Copy Markdown
Contributor

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

@openshift-ci openshift-ci Bot requested review from antonioromito and dciabrin June 22, 2026 11:19
@openshift-ci

openshift-ci Bot commented Jun 22, 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

@lmiccini

Copy link
Copy Markdown
Contributor Author

/test infra-operator-build-deploy-kuttl

lmiccini and others added 3 commits June 23, 2026 12:06
… 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>
ManageTransportSecretFinalizer and RemoveTransportSecretConsumerFinalizer
are now available as generic object.ManageSecretConsumerFinalizer and
object.RemoveSecretConsumerFinalizer in lib-common. Consumer operators
should migrate to the lib-common versions.

Keep HasTransportConsumerFinalizer and HasSpecificTransportConsumerFinalizer
which are provider-side helpers used by the TransportURL controller.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the transport consumer finalizer check from the exported API
helper into a private function in the controller — the only consumer.
Delete transporturl_helpers.go entirely since all exported helpers are
now either in lib-common (ManageSecretConsumerFinalizer,
RemoveSecretConsumerFinalizer) or inlined here.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lmiccini lmiccini force-pushed the finalize-secret-rotation branch from 7bda5c0 to aca54b9 Compare June 23, 2026 10:07
@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/4125cf97bf4045b491bcc003d054f746

openstack-k8s-operators-content-provider FAILURE in 11m 20s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

@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/a3133523ffb44b82a68d14705892e330

openstack-k8s-operators-content-provider FAILURE in 10m 14s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

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