Skip to content

Commit aa52627

Browse files
committed
Set EDPM service annotation on nova and ceilometer ACs
Set the `keystone.openstack.org/edpm-service` annotation on nova and ceilometer ApplicationCredential CRs so the keystone-operator AC controller can gate secret rotation and deletion on EDPM NodeSet hash sync. Other services are not EDPM services and can proceed without the NodeSet check. Signed-off-by: Veronika Fisarova <vfisarov@redhat.com> Assisted-by: Claude Opus 4.6 noreply@anthropic.com
1 parent b9613ec commit aa52627

24 files changed

Lines changed: 76 additions & 15 deletions

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260519055836-98aca178b9cd
1616
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260518151731-513cdc50e41c
1717
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260519055835-3fc462342d6c
18-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260518173352-69a47a6187d5
18+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260520090027-4d7b7a01c0bf
1919
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587
2020
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20260518125357-72bdd580c587
2121
github.com/openstack-k8s-operators/manila-operator/api v0.6.1-0.20260519055834-18a3bfb29f4a

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260518151731-5
130130
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260518151731-513cdc50e41c/go.mod h1:RFFB4Zs9IJv1jXs/yMjo+VswSW+rsrFZsoP0QrB1EbI=
131131
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260519055835-3fc462342d6c h1:441tIuWdcTeeNDWjILS4XScC3hd65tWRb7YyUBe8F24=
132132
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260519055835-3fc462342d6c/go.mod h1:R3MsU1uiqYkLXw7yRJ9VZYvpPDiQAJK08EfyZLZZeZk=
133-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260518173352-69a47a6187d5 h1:eKSWFldHZyv3Q6Q8xO6IfvlKUxcQ1GstOPCa8HnlWEc=
134-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260518173352-69a47a6187d5/go.mod h1:voVyXEWocD4O+I+bIXLZovkzL51RE17deynYYgKbs0w=
133+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260520090027-4d7b7a01c0bf h1:FoKK0zNo48i4ZMFxScupCK/YAmy6Ps4IILz3CK4BCTI=
134+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260520090027-4d7b7a01c0bf/go.mod h1:VNX1Mda2u5+yGxycIyVrgABucitMDR9ct3Lj6ROS92I=
135135
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587 h1:p03uEXoSreyu7LpFmb9YyYM8tEx2D2+7qqhLXNWHTq0=
136136
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587/go.mod h1:JC04T5G4E/he5ukonV1oCqa0QzFkLv761VbLruVghJM=
137137
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20260506154724-30a976ba8ef0 h1:kMie+G0aHlGwDHjimjj8AUxTl2R7LGfai/8pev2T+TY=

bindata/crds/keystone.openstack.org_keystoneapplicationcredentials.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ spec:
209209
for this ApplicationCredential.
210210
format: int64
211211
type: integer
212+
previousSecretName:
213+
description: PreviousSecretName - name of the previous AC secret.
214+
Only current and previous are protected by finalizer.
215+
type: string
212216
rotationEligibleAt:
213217
description: |-
214218
RotationEligibleAt indicates when rotation becomes eligible (start of grace period window).

bindata/rbac/keystone-operator-rbac.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ rules:
135135
- patch
136136
- update
137137
- watch
138+
- apiGroups:
139+
- dataplane.openstack.org
140+
resources:
141+
- openstackdataplanenodesets
142+
verbs:
143+
- get
144+
- list
145+
- watch
138146
- apiGroups:
139147
- k8s.cni.cncf.io
140148
resources:

config/operator/manager_operator_images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
- name: RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL
3131
value: quay.io/openstack-k8s-operators/ironic-operator@sha256:2c3cb7bbab9f294b00f302ad7f951fe888d80e4acc78aef7ef23a4869711d2bf
3232
- name: RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL
33-
value: quay.io/openstack-k8s-operators/keystone-operator@sha256:d92d73580846a154e5c5746370e4223e5473f231a816b0b3a4060f149cac4586
33+
value: quay.io/openstack-k8s-operators/keystone-operator@sha256:c9270b37a19ec4637f8f69bd0973724f71e1376cfc002d0265137b8a57f505a6
3434
- name: RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL
3535
value: quay.io/openstack-k8s-operators/manila-operator@sha256:f0aed94235d37b13ae9e6163655dbbb9df7a309e495ebba7f4cd1747d5e72391
3636
- name: RELATED_IMAGE_MARIADB_OPERATOR_MANAGER_IMAGE_URL

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260519055836-98aca178b9cd
2121
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260518151731-513cdc50e41c
2222
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260519055835-3fc462342d6c
23-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260518173352-69a47a6187d5
23+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260520090027-4d7b7a01c0bf
2424
github.com/openstack-k8s-operators/lib-common/modules/ansible v0.6.1-0.20260518125357-72bdd580c587
2525
github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.6.1-0.20260518125357-72bdd580c587
2626
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260518125357-72bdd580c587

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260518151731-5
154154
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260518151731-513cdc50e41c/go.mod h1:RFFB4Zs9IJv1jXs/yMjo+VswSW+rsrFZsoP0QrB1EbI=
155155
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260519055835-3fc462342d6c h1:441tIuWdcTeeNDWjILS4XScC3hd65tWRb7YyUBe8F24=
156156
github.com/openstack-k8s-operators/ironic-operator/api v0.6.1-0.20260519055835-3fc462342d6c/go.mod h1:R3MsU1uiqYkLXw7yRJ9VZYvpPDiQAJK08EfyZLZZeZk=
157-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260518173352-69a47a6187d5 h1:eKSWFldHZyv3Q6Q8xO6IfvlKUxcQ1GstOPCa8HnlWEc=
158-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260518173352-69a47a6187d5/go.mod h1:voVyXEWocD4O+I+bIXLZovkzL51RE17deynYYgKbs0w=
157+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260520090027-4d7b7a01c0bf h1:FoKK0zNo48i4ZMFxScupCK/YAmy6Ps4IILz3CK4BCTI=
158+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260520090027-4d7b7a01c0bf/go.mod h1:VNX1Mda2u5+yGxycIyVrgABucitMDR9ct3Lj6ROS92I=
159159
github.com/openstack-k8s-operators/lib-common/modules/ansible v0.6.1-0.20260518125357-72bdd580c587 h1:VvXvQw3t7slykvGeb+/CzmnTilSpQV2ji6gjJhHD/XU=
160160
github.com/openstack-k8s-operators/lib-common/modules/ansible v0.6.1-0.20260518125357-72bdd580c587/go.mod h1:tXxVkkk8HlATwTmDA5RTP3b+c8apfuMM15mZ2wW5iNs=
161161
github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.6.1-0.20260518125357-72bdd580c587 h1:vCttV5sUx7vQLsQGBEjfXvp/xJo29UyW2srkyAcoTbc=

hack/export_operator_related_images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-opera
88
export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:7800616b815863423484fe0537ef77fbb7cd3f635c864c098ec95dd004d4224b
99
export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/infra-operator@sha256:938b73f665d9d432a4a7e67d347f1504f06b8e143c740246a9c7c6d5630a7ff4
1010
export RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/ironic-operator@sha256:2c3cb7bbab9f294b00f302ad7f951fe888d80e4acc78aef7ef23a4869711d2bf
11-
export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:d92d73580846a154e5c5746370e4223e5473f231a816b0b3a4060f149cac4586
11+
export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:c9270b37a19ec4637f8f69bd0973724f71e1376cfc002d0265137b8a57f505a6
1212
export RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/manila-operator@sha256:f0aed94235d37b13ae9e6163655dbbb9df7a309e495ebba7f4cd1747d5e72391
1313
export RELATED_IMAGE_MARIADB_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/mariadb-operator@sha256:db4edc84736a517e632c7201fc7015fea401d997ffcfa9d60ca11c46df74224e
1414
export RELATED_IMAGE_NEUTRON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/neutron-operator@sha256:ad4a7d9fb687b6d89ecda9b03067f9baa002c7c7f8ac89daebf9732351c86b9e

internal/openstack/applicationcredential.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ func CleanupApplicationCredentialForService(
6868
instance *corev1beta1.OpenStackControlPlane,
6969
serviceName string,
7070
) error {
71+
Log := GetLogger(ctx)
7172
acName := keystonev1.GetACCRName(serviceName)
73+
7274
acCR := &keystonev1.KeystoneApplicationCredential{
7375
ObjectMeta: metav1.ObjectMeta{
7476
Name: acName,
7577
Namespace: instance.Namespace,
7678
},
7779
}
78-
Log := GetLogger(ctx)
7980
err := helper.GetClient().Delete(ctx, acCR)
8081
if k8s_errors.IsNotFound(err) {
8182
return nil
@@ -106,6 +107,7 @@ func EnsureApplicationCredentialForService(
106107
passwordSelector string,
107108
serviceUser string,
108109
acConfig *corev1beta1.ServiceAppCredSection,
110+
edpmService bool,
109111
) (acSecretName string, result ctrl.Result, err error) {
110112
Log := GetLogger(ctx)
111113

@@ -154,7 +156,7 @@ func EnsureApplicationCredentialForService(
154156
// Check if AC CR exists and is ready
155157
if acExists {
156158
// We want to run reconcileApplicationCredential to update the AC CR if it exists and is ready and AC config fields changed
157-
err = reconcileApplicationCredential(ctx, helper, instance, acName, serviceUser, secretName, passwordSelector, merged)
159+
err = reconcileApplicationCredential(ctx, helper, instance, acName, serviceUser, secretName, passwordSelector, merged, edpmService)
158160
if err != nil {
159161
return "", ctrl.Result{}, err
160162
}
@@ -177,7 +179,7 @@ func EnsureApplicationCredentialForService(
177179
// Service is ready, create Application Credential CR
178180
Log.Info("Service is ready, creating Application Credential", "service", serviceName, "acName", acName)
179181

180-
err = reconcileApplicationCredential(ctx, helper, instance, acName, serviceUser, secretName, passwordSelector, merged)
182+
err = reconcileApplicationCredential(ctx, helper, instance, acName, serviceUser, secretName, passwordSelector, merged, edpmService)
181183
if err != nil {
182184
return "", ctrl.Result{}, err
183185
}
@@ -196,6 +198,7 @@ func reconcileApplicationCredential(
196198
secretName string,
197199
passwordSelector string,
198200
effective corev1beta1.ApplicationCredentialSection,
201+
edpmService bool,
199202
) error {
200203
log := GetLogger(ctx)
201204

@@ -215,6 +218,17 @@ func reconcileApplicationCredential(
215218
acObj.Spec.Roles = effective.Roles
216219
acObj.Spec.Unrestricted = *effective.Unrestricted
217220

221+
annotations := acObj.GetAnnotations()
222+
if annotations == nil {
223+
annotations = map[string]string{}
224+
}
225+
if edpmService {
226+
annotations[keystonev1.EDPMServiceAnnotation] = "true"
227+
} else {
228+
annotations[keystonev1.EDPMServiceAnnotation] = "false"
229+
}
230+
acObj.SetAnnotations(annotations)
231+
218232
if len(effective.AccessRules) > 0 {
219233
kr := make([]keystonev1.ACRule, 0, len(effective.AccessRules))
220234
for _, r := range effective.AccessRules {

internal/openstack/barbican.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func ReconcileBarbican(ctx context.Context, instance *corev1beta1.OpenStackContr
9191
instance.Spec.Barbican.Template.PasswordSelectors.Service,
9292
instance.Spec.Barbican.Template.ServiceUser,
9393
instance.Spec.Barbican.ApplicationCredential,
94+
false,
9495
)
9596
if err != nil {
9697
return ctrl.Result{}, err

0 commit comments

Comments
 (0)