Skip to content

Commit 04cc55a

Browse files
committed
Implement rabbitmquser finalizer management for edpm nodes
1 parent 83d359c commit 04cc55a

25 files changed

+3211
-42
lines changed

api/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,14 @@ spec:
19731973
items:
19741974
type: string
19751975
type: array
1976+
finalizerHash:
1977+
description: |-
1978+
FinalizerHash is a short, deterministic hash derived from the nodeset name.
1979+
Used to create unique, collision-free finalizer names for RabbitMQ users.
1980+
Format: first 8 characters of SHA256(nodeset.metadata.name)
1981+
Example: "a3f2b5c8"
1982+
This allows easy lookup of which nodeset owns a specific finalizer.
1983+
type: string
19761984
inventorySecretName:
19771985
description: InventorySecretName Name of a secret containing the ansible
19781986
inventory

api/core/v1beta1/openstackcontrolplane_webhook.go

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
881881
if r.Spec.Cinder.Template.MessagingBus.Cluster == "" {
882882
r.Spec.Cinder.Template.MessagingBus.Cluster = "rabbitmq"
883883
}
884-
// Propagate top-level NotificationsBus to template if not already set
885-
// This prevents the service operator's Default() from using the deprecated field
886-
if r.Spec.Cinder.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
887-
r.Spec.Cinder.Template.NotificationsBus = r.Spec.NotificationsBus
888-
}
884+
// NotificationsBus propagation is handled in the reconcile loop to properly support
885+
// both inheritance and clearing. The webhook doesn't have access to the old object
886+
// to distinguish between user overrides and inherited values.
889887
r.Spec.Cinder.Template.Default()
890888
initializeOverrideSpec(&r.Spec.Cinder.APIOverride.Route, true)
891889
r.Spec.Cinder.Template.SetDefaultRouteAnnotations(r.Spec.Cinder.APIOverride.Route.Annotations)
@@ -915,11 +913,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
915913
if r.Spec.Glance.Template == nil {
916914
r.Spec.Glance.Template = &glancev1.GlanceSpecCore{}
917915
}
918-
// Propagate top-level NotificationsBus to template if not already set
919-
// This prevents the service operator's Default() from using the deprecated field
920-
if r.Spec.Glance.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
921-
r.Spec.Glance.Template.NotificationsBus = r.Spec.NotificationsBus
922-
}
916+
// NotificationsBus propagation is handled in the reconcile loop to properly support
917+
// both inheritance and clearing. The webhook doesn't have access to the old object
918+
// to distinguish between user overrides and inherited values.
923919
r.Spec.Glance.Template.Default()
924920
// initialize the main APIOverride struct
925921
if r.Spec.Glance.APIOverride == nil {
@@ -984,11 +980,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
984980
if r.Spec.Keystone.Template == nil {
985981
r.Spec.Keystone.Template = &keystonev1.KeystoneAPISpecCore{}
986982
}
987-
// Propagate top-level NotificationsBus to template if not already set
988-
// This prevents the service operator's Default() from using the deprecated field
989-
if r.Spec.Keystone.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
990-
r.Spec.Keystone.Template.NotificationsBus = r.Spec.NotificationsBus
991-
}
983+
// NotificationsBus propagation is handled in the reconcile loop to properly support
984+
// both inheritance and clearing. The webhook doesn't have access to the old object
985+
// to distinguish between user overrides and inherited values.
992986
r.Spec.Keystone.Template.Default()
993987
initializeOverrideSpec(&r.Spec.Keystone.APIOverride.Route, true)
994988
r.Spec.Keystone.Template.SetDefaultRouteAnnotations(r.Spec.Keystone.APIOverride.Route.Annotations)
@@ -1003,11 +997,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
1003997
if r.Spec.Manila.Template.MessagingBus.Cluster == "" {
1004998
r.Spec.Manila.Template.MessagingBus.Cluster = "rabbitmq"
1005999
}
1006-
// Propagate top-level NotificationsBus to template if not already set
1007-
// This prevents the service operator's Default() from using the deprecated field
1008-
if r.Spec.Manila.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
1009-
r.Spec.Manila.Template.NotificationsBus = r.Spec.NotificationsBus
1010-
}
1000+
// NotificationsBus propagation is handled in the reconcile loop to properly support
1001+
// both inheritance and clearing. The webhook doesn't have access to the old object
1002+
// to distinguish between user overrides and inherited values.
10111003
r.Spec.Manila.Template.Default()
10121004
initializeOverrideSpec(&r.Spec.Manila.APIOverride.Route, true)
10131005
r.Spec.Manila.Template.SetDefaultRouteAnnotations(r.Spec.Manila.APIOverride.Route.Annotations)
@@ -1035,11 +1027,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
10351027
if r.Spec.Neutron.Template.MessagingBus.Cluster == "" {
10361028
r.Spec.Neutron.Template.MessagingBus.Cluster = "rabbitmq"
10371029
}
1038-
// Propagate top-level NotificationsBus to template if not already set
1039-
// This prevents the service operator's Default() from using the deprecated field
1040-
if r.Spec.Neutron.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
1041-
r.Spec.Neutron.Template.NotificationsBus = r.Spec.NotificationsBus
1042-
}
1030+
// NotificationsBus propagation is handled in the reconcile loop to properly support
1031+
// both inheritance and clearing. The webhook doesn't have access to the old object
1032+
// to distinguish between user overrides and inherited values.
10431033
r.Spec.Neutron.Template.Default()
10441034
initializeOverrideSpec(&r.Spec.Neutron.APIOverride.Route, true)
10451035
r.Spec.Neutron.Template.SetDefaultRouteAnnotations(r.Spec.Neutron.APIOverride.Route.Annotations)
@@ -1055,11 +1045,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
10551045
if r.Spec.Nova.Template.MessagingBus.Cluster == "" {
10561046
r.Spec.Nova.Template.MessagingBus.Cluster = "rabbitmq"
10571047
}
1058-
// Propagate top-level NotificationsBus to template if not already set
1059-
// This prevents the service operator's Default() from using the deprecated field
1060-
if r.Spec.Nova.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
1061-
r.Spec.Nova.Template.NotificationsBus = r.Spec.NotificationsBus
1062-
}
1048+
// NotificationsBus propagation is handled in the reconcile loop to properly support
1049+
// both inheritance and clearing. The webhook doesn't have access to the old object
1050+
// to distinguish between user overrides and inherited values.
10631051
r.Spec.Nova.Template.Default()
10641052
initializeOverrideSpec(&r.Spec.Nova.APIOverride.Route, true)
10651053
r.Spec.Nova.Template.SetDefaultRouteAnnotations(r.Spec.Nova.APIOverride.Route.Annotations)
@@ -1211,11 +1199,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
12111199
if r.Spec.Watcher.Template.MessagingBus.Cluster == "" {
12121200
r.Spec.Watcher.Template.MessagingBus.Cluster = "rabbitmq"
12131201
}
1214-
// Propagate top-level NotificationsBus to template if not already set
1215-
// This prevents the service operator's Default() from using the deprecated field
1216-
if r.Spec.Watcher.Template.NotificationsBus == nil && r.Spec.NotificationsBus != nil {
1217-
r.Spec.Watcher.Template.NotificationsBus = r.Spec.NotificationsBus
1218-
}
1202+
// NotificationsBus propagation is handled in the reconcile loop to properly support
1203+
// both inheritance and clearing. The webhook doesn't have access to the old object
1204+
// to distinguish between user overrides and inherited values.
12191205
r.Spec.Watcher.Template.Default()
12201206

12211207
if r.Spec.Watcher.Enabled {

api/dataplane/v1beta1/openstackdataplanenodeset_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ type OpenStackDataPlaneNodeSetStatus struct {
160160

161161
//DeployedBmhHash - Hash of BMHs deployed
162162
DeployedBmhHash string `json:"deployedBmhHash,omitempty"`
163+
164+
// FinalizerHash is a short, deterministic hash derived from the nodeset name.
165+
// Used to create unique, collision-free finalizer names for RabbitMQ users.
166+
// Format: first 8 characters of SHA256(nodeset.metadata.name)
167+
// Example: "a3f2b5c8"
168+
// This allows easy lookup of which nodeset owns a specific finalizer.
169+
FinalizerHash string `json:"finalizerHash,omitempty"`
163170
}
164171

165172
// +kubebuilder:object:root=true

bindata/crds/crds.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19734,6 +19734,11 @@ spec:
1973419734
description: InventorySecretName Name of a secret containing the ansible
1973519735
inventory
1973619736
type: string
19737+
novaCellSecretHash:
19738+
description: |-
19739+
NovaCellSecretHash - Hash of nova-cellX-compute-config secrets to detect changes.
19740+
When this hash changes, UpdatedNodesAfterSecretChange is reset.
19741+
type: string
1973719742
observedGeneration:
1973819743
description: ObservedGeneration - the most recent generation observed
1973919744
for this NodeSet. If the observed generation is less than the spec
@@ -19745,6 +19750,15 @@ spec:
1974519750
type: string
1974619751
description: SecretHashes
1974719752
type: object
19753+
updatedNodesAfterSecretChange:
19754+
description: |-
19755+
UpdatedNodesAfterSecretChange - List of node names that have been successfully
19756+
updated after the most recent nova cell secret change. This is used to track
19757+
progress across multiple AnsibleLimit deployments and ensure all nodes are
19758+
updated before removing RabbitMQ user finalizers.
19759+
items:
19760+
type: string
19761+
type: array
1974819762
type: object
1974919763
type: object
1975019764
served: true

bindata/rbac/rbac.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,23 @@ rules:
645645
- patch
646646
- update
647647
- watch
648+
- apiGroups:
649+
- rabbitmq.openstack.org
650+
resources:
651+
- rabbitmqusers
652+
verbs:
653+
- get
654+
- list
655+
- patch
656+
- update
657+
- watch
658+
- apiGroups:
659+
- rabbitmq.openstack.org
660+
resources:
661+
- rabbitmqusers/finalizers
662+
verbs:
663+
- patch
664+
- update
648665
- apiGroups:
649666
- rbac.authorization.k8s.io
650667
resources:

config/crd/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,14 @@ spec:
19731973
items:
19741974
type: string
19751975
type: array
1976+
finalizerHash:
1977+
description: |-
1978+
FinalizerHash is a short, deterministic hash derived from the nodeset name.
1979+
Used to create unique, collision-free finalizer names for RabbitMQ users.
1980+
Format: first 8 characters of SHA256(nodeset.metadata.name)
1981+
Example: "a3f2b5c8"
1982+
This allows easy lookup of which nodeset owns a specific finalizer.
1983+
type: string
19761984
inventorySecretName:
19771985
description: InventorySecretName Name of a secret containing the ansible
19781986
inventory

config/operator/deployment/kustomization.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ patches:
2727
kind: Deployment
2828
name: openstack-operator-controller-init
2929
namespace: system
30+
- patch: '[{"op": "replace", "path": "/spec/template/spec/containers/0/env/0", "value":
31+
{"name": "OPENSTACK_RELEASE_VERSION", "value": "0.1.17-1768984468"}}]'
32+
target:
33+
kind: Deployment
34+
name: openstack-operator-controller-operator
35+
namespace: system

config/rbac/role.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,23 @@ rules:
596596
- patch
597597
- update
598598
- watch
599+
- apiGroups:
600+
- rabbitmq.openstack.org
601+
resources:
602+
- rabbitmqusers
603+
verbs:
604+
- get
605+
- list
606+
- patch
607+
- update
608+
- watch
609+
- apiGroups:
610+
- rabbitmq.openstack.org
611+
resources:
612+
- rabbitmqusers/finalizers
613+
verbs:
614+
- patch
615+
- update
599616
- apiGroups:
600617
- rbac.authorization.k8s.io
601618
resources:

0 commit comments

Comments
 (0)