Skip to content

Commit 4a0e940

Browse files
committed
refactor: use GetKeystoneAPIByName instead of label-based lookup
- Replace GetKeystoneAPI with GetKeystoneAPIByName in nova_controller.go - use instance.Spec.KeystoneInstance directly instead of empty label map - Remove TODO comment about changing the API usage. - Update keystone-operator/api dependency to support new functionality This provides a more direct and efficient way to get the KeystoneAPI resource by name rather then searching by labels. Commit message assisted by: claude-4-sonnet
1 parent a68262c commit 4a0e940

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

controllers/nova_controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,10 +1649,7 @@ func (r *NovaReconciler) getKeystoneAuthURL(
16491649
h *helper.Helper,
16501650
instance *novav1.Nova,
16511651
) (string, string, error) {
1652-
// TODO(gibi): change lib-common to take the name of the KeystoneAPI as
1653-
// parameter instead of labels. Then use instance.Spec.KeystoneInstance as
1654-
// the name.
1655-
keystoneAPI, err := keystonev1.GetKeystoneAPI(ctx, h, instance.Namespace, map[string]string{})
1652+
keystoneAPI, err := keystonev1.GetKeystoneAPIByName(ctx, h, instance.Spec.KeystoneInstance, instance.Namespace)
16561653
if err != nil {
16571654
return "", "", err
16581655
}

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ require (
8787

8888
replace github.com/openstack-k8s-operators/nova-operator/api => ./api
8989

90+
replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250818061624-cbdfd1f68df8
91+
9092
// mschuppert: map to latest commit from release-4.16 tag
9193
// must consistent within modules and service operators
9294
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 //allow-merging

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 h1:J1wuGhVxpsHykZBa6
8080
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
8181
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250813063935-fdc20530dcf1 h1:77TRnwfSxNI5cn/RxMS9I+kqefMm7XRQsNknIhEE4tg=
8282
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250813063935-fdc20530dcf1/go.mod h1:Dv8qpmBIQy3Jv/EyQnOyc0w61X8vyfxpjcIQONP5CwY=
83-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250811083324-e790d63f389f h1:Ivo4YKaH26B1lQlwKcolELCRGtEbmvbfJShBTVrCdQI=
84-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250811083324-e790d63f389f/go.mod h1:H5iZOohoVOmZvIZPR5ep6z+jmfrpz25axOM6IXlXzNU=
83+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250818061624-cbdfd1f68df8 h1:1r3wSalcW2TY8K3X6j5cL0M9MgJDCI1nZ7tHne/Izlg=
84+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20250818061624-cbdfd1f68df8/go.mod h1:H5iZOohoVOmZvIZPR5ep6z+jmfrpz25axOM6IXlXzNU=
8585
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250730071847-837b07f8d72f h1:DW8aNjEtDFrWiZ6vWuOXwdRB4eBD0n+bA9foQkOEx6U=
8686
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250730071847-837b07f8d72f/go.mod h1:P+7F1wiwZUxOy4myYXFyc/uBtGATDFpk3yAllXe1Vzk=
8787
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20250730071847-837b07f8d72f h1:nGYLHcpM7EjiSzN4bmiLZbxty9u0k0Qzvkqn+1s1TF0=

0 commit comments

Comments
 (0)