Commit f364c0e
Add staged deployment support for control plane restore
Add support for pausing OpenStackControlPlane deployment after
infrastructure creation to enable database restore before OpenStack
services start. 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
- Add condition messages (Init, Ready, Running, Error)
- 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()
**New helper function:**
- isInfrastructureReady(): Checks if all enabled infrastructure components are ready
- Always checks: CAs (no enabled flag)
- Conditionally checks: DNS, RabbitMQ, Galera, Memcached, OVN (only if enabled)
- Fixes test failures when OVN or other components are disabled
**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
- Return early (skip service reconciliation)
- Message: "Infrastructure ready - deployment paused. Remove annotation to resume"
- 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"
Update all kuttl test assertions to expect InfrastructureReady condition:
- 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-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 enables the backup/restore workflow:
1. Apply OpenStackControlPlane CR with annotation:
core.openstack.org/deployment-stage: infrastructure-only
2. Wait for InfrastructureReady condition:
oc wait --for=condition=InfrastructureReady 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 (no db_sync conflicts)
- Clean database restore without service restarts
- Services start with existing data intact
- Clear user visibility via condition message
- Works with optional infrastructure components (OVN can be disabled)
Jira: OSPRH-25752
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Signed-off-by: Martin Schuppert <[email protected]>1 parent 0385ac2 commit f364c0e
File tree
18 files changed
+289
-5
lines changed- api/core/v1beta1
- internal/controller/core
- test/kuttl
- common
- tests
- ctlplane-basic-deployment
- ctlplane-collapsed
- ctlplane-galera-3replicas
- ctlplane-staged-deployment
- ctlplane-tls-cert-rotation
- ctlplane-tls-custom-issuers
- ctlplane-tls-custom-route
18 files changed
+289
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| |||
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
510 | 530 | | |
511 | 531 | | |
512 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
951 | 956 | | |
952 | 957 | | |
953 | 958 | | |
| 959 | + | |
954 | 960 | | |
955 | 961 | | |
956 | 962 | | |
| |||
Lines changed: 87 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
389 | 420 | | |
390 | 421 | | |
391 | 422 | | |
| |||
402 | 433 | | |
403 | 434 | | |
404 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
405 | 441 | | |
406 | 442 | | |
407 | 443 | | |
| |||
437 | 473 | | |
438 | 474 | | |
439 | 475 | | |
440 | | - | |
| 476 | + | |
| 477 | + | |
441 | 478 | | |
442 | 479 | | |
443 | 480 | | |
444 | 481 | | |
445 | 482 | | |
446 | 483 | | |
447 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
448 | 528 | | |
449 | 529 | | |
450 | 530 | | |
451 | 531 | | |
452 | 532 | | |
453 | 533 | | |
454 | | - | |
| 534 | + | |
455 | 535 | | |
456 | 536 | | |
457 | 537 | | |
458 | 538 | | |
459 | 539 | | |
460 | 540 | | |
461 | | - | |
| 541 | + | |
462 | 542 | | |
463 | 543 | | |
464 | 544 | | |
465 | 545 | | |
466 | 546 | | |
467 | 547 | | |
468 | | - | |
| 548 | + | |
469 | 549 | | |
470 | 550 | | |
471 | 551 | | |
472 | 552 | | |
473 | 553 | | |
474 | 554 | | |
| 555 | + | |
| 556 | + | |
475 | 557 | | |
476 | 558 | | |
477 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
Lines changed: 105 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments