You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cc8589c
Browse filesBrowse the repository at this point in the historyBrowse files
Add support for pausing OpenStackControlPlane deployment after
infrastructure creation. This enables a user to perform an action like,
database restore before creating OpenStack services.
This is useful for backup/restore scenarios where databases need to be
restored to empty infrastructure before services initialize fresh schemas.
**conditions.go:**
- Add OpenStackControlPlaneInfrastructureReadyCondition type
- Uses "OpenStackControlPlaneInfrastructureReady" as the condition type name
- Aligns with naming convention (all conditions have OpenStackControlPlane prefix)
- Add condition messages (Init, Ready, Running, Error, Waiting, Paused)
- Add OpenStackControlPlaneInfrastructureReadyWaitingMessage to show blocking components
- Add OpenStackControlPlaneInfrastructureReadyPausedMessage for infrastructure-only mode
- Infrastructure includes: CAs, DNSMasq, RabbitMQ, Galera, Memcached, OVN
**openstackcontrolplane_types.go:**
- Add DeploymentStageAnnotation constant ("core.openstack.org/deployment-stage")
- Add DeploymentStageInfrastructureOnly constant ("infrastructure-only")
- Add InfrastructureReady condition to InitConditions()
**Enhanced infrastructure status reporting:**
- isInfrastructureReady(): Returns ready status AND list of not-ready components
- Always checks: CAs (no enabled flag)
- Conditionally checks: DNS, RabbitMQ, Galera, Memcached, OVN (only if enabled)
- Returns which components are blocking when infrastructure not ready
- Fixes test failures when OVN or other components are disabled
- InfrastructureReady condition shows detailed waiting message:
- "Infrastructure in progress - waiting for: RabbitMQs, Galeras"
- Makes debugging deployment issues much easier
**Ready condition handling in infrastructure-only mode:**
- Defer block now checks for infrastructure-only mode
- When infrastructure-only AND infrastructure ready:
- Mirror InfrastructureReady pause message to Ready condition (as False)
- Prevents service conditions (Unknown/Init) from leaking into Ready
- When infrastructure not ready OR normal mode:
- Use default mirror behavior (first not-ready condition)
- Result: Ready condition shows appropriate message at each stage
**Staged deployment logic:**
- Move OVN reconciliation to infrastructure section (before services)
- Check deployment-stage annotation after infrastructure reconciliation
- When annotation = "infrastructure-only":
- Set InfrastructureReady condition with pause message
- Set Ready condition to False with pause message (via defer block)
- Return early (skip service reconciliation)
- Message: "Infrastructure ready - deployment paused. Remove annotation to resume deployment of OpenStack services"
- When annotation not set (normal deployment):
- Set InfrastructureReady condition with standard message
- Continue with full service reconciliation
- Message: "Infrastructure ready"
- When infrastructure still deploying:
- Set InfrastructureReady = False/Requested
- Message: "Infrastructure in progress - waiting for: <components>"
**Kuttl test for staged deployment:**
- New test: test/kuttl/tests/ctlplane-staged-deployment/
- Validates full workflow:
1. Deploy with infrastructure-only annotation
2. Assert infrastructure ready, services Unknown, Ready shows pause message
3. Remove annotation
4. Assert full controlplane reaches Ready
- Tests the pause/resume cycle for backup/restore scenarios
**Update all kuttl test assertions:**
- Use OpenStackControlPlaneInfrastructureReady
- Condition is placed alphabetically (after Glance, before InstanceHa)
- Conditions are sorted: Ready first, then all others alphabetically by type
- Updated files:
- common/assert-sample-deployment.yaml
- ctlplane-basic-deployment/03-assert-deploy-custom-cacert.yaml
- ctlplane-collapsed/01-assert-collapsed-cell.yaml
- ctlplane-galera-3replicas/01-assert-galera-3replicas.yaml
- ctlplane-staged-deployment/01-assert-infrastructure-ready-paused.yaml
- ctlplane-tls-cert-rotation/00-assert-deploy-openstack.yaml
- ctlplane-tls-cert-rotation/03-assert-new-certs.yaml
- ctlplane-tls-custom-issuers/01-assert-deploy-openstack.yaml
- ctlplane-tls-custom-issuers/09-assert-deploy-openstack.yaml
- ctlplane-tls-custom-route/03-assert-deploy-openstack.yaml
This allows a workflow like this, which can be used for backup/restore:
1. Apply OpenStackControlPlane CR with annotation:
core.openstack.org/deployment-stage: infrastructure-only
2. Wait for InfrastructureReady condition:
oc wait --for=condition=OpenStackControlPlaneInfrastructureReady openstackcontrolplane/openstack
3. Restore databases (MariaDB, OVN) to empty infrastructure
4. Restore RabbitMQ user credentials for EDPM compatibility
5. Remove annotation to resume deployment:
oc annotate openstackcontrolplane openstack core.openstack.org/deployment-stage-
6. Services start with already-restored databases
Jira: OSPRH-25752
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
0 commit comments