Skip to content

Commit 51b1e07

Browse files
committed
Application Credential support
Signed-off-by: Veronika Fisarova <[email protected]>
1 parent b8260d6 commit 51b1e07

15 files changed

+277
-8
lines changed

api/bases/cinder.openstack.org_cinderapis.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ spec:
5252
spec:
5353
description: CinderAPISpec defines the desired state of CinderAPI
5454
properties:
55+
auth:
56+
description: Auth - Parameters related to authentication
57+
properties:
58+
applicationCredentialSecret:
59+
description: ApplicationCredentialSecret - Secret containing Application
60+
Credential ID and Secret
61+
type: string
62+
type: object
5563
containerImage:
5664
description: ContainerImage - Cinder Container Image URL (will be
5765
set to environmental default if empty)

api/bases/cinder.openstack.org_cinders.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ spec:
5757
description: CinderAPI - Spec definition for the API service of this
5858
Cinder deployment
5959
properties:
60+
auth:
61+
description: Auth - Parameters related to authentication
62+
properties:
63+
applicationCredentialSecret:
64+
description: ApplicationCredentialSecret - Secret containing
65+
Application Credential ID and Secret
66+
type: string
67+
type: object
6068
containerImage:
6169
description: ContainerImage - Cinder Container Image URL (will
6270
be set to environmental default if empty)

api/go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.24.4
44

55
require (
66
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96
7+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20251128160419-8b3a77972a77
78
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251122131503-b76943960b6c
89
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251122131503-b76943960b6c
910
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
@@ -17,7 +18,6 @@ require (
1718
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1819
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1920
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
20-
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
2121
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
2222
github.com/fsnotify/fsnotify v1.9.0 // indirect
2323
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
@@ -32,13 +32,16 @@ require (
3232
github.com/google/go-cmp v0.7.0 // indirect
3333
github.com/google/gofuzz v1.2.0 // indirect
3434
github.com/google/uuid v1.6.0 // indirect
35+
github.com/gophercloud/gophercloud/v2 v2.8.0 // indirect
3536
github.com/imdario/mergo v0.3.16 // indirect
3637
github.com/josharian/intern v1.0.0 // indirect
3738
github.com/json-iterator/go v1.1.12 // indirect
3839
github.com/mailru/easyjson v0.9.0 // indirect
3940
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4041
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
4142
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
43+
github.com/openshift/api v3.9.0+incompatible // indirect
44+
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251103072528-9eb684fef4ef // indirect
4245
github.com/pkg/errors v0.9.1 // indirect
4346
github.com/prometheus/client_golang v1.22.0 // indirect
4447
github.com/prometheus/client_model v0.6.2 // indirect
@@ -94,3 +97,5 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.13 //allow-merging
9497
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec //allow-merging
9598

9699
replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging
100+
101+
replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81

api/go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81 h1:plax+NFgJJL1SrERyXAnf3jOHRhLTtBlJ2oc7d84EoU=
2+
github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81/go.mod h1:b98Jl8eyUw8V07l9YiuQnoMlnWC748oV8IhXH15NCC4=
13
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
24
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
35
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -48,6 +50,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
4850
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
4951
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
5052
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
53+
github.com/gophercloud/gophercloud/v2 v2.8.0 h1:of2+8tT6+FbEYHfYC8GBu8TXJNsXYSNm9KuvpX7Neqo=
54+
github.com/gophercloud/gophercloud/v2 v2.8.0/go.mod h1:Ki/ILhYZr/5EPebrPL9Ej+tUg4lqx71/YH2JWVeU+Qk=
5155
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
5256
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
5357
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -78,10 +82,14 @@ github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns
7882
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
7983
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
8084
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
85+
github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e h1:E1OdwSpqWuDPCedyUt0GEdoAE+r5TXy7YS21yNEo+2U=
86+
github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
8187
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96 h1:hPgCcrbRHBPfngaEPe6coaCtcauMolI71lfcLdinrKI=
8288
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251205192058-5cfbada0ab96/go.mod h1:ZuglN7IqXfIo75WcJwe0NLHhu82Fs3k/5IXptqnO1H4=
8389
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251122131503-b76943960b6c h1:wM8qXCB5mQwSosCvtaydzuXitWVVKBHTzH0A2znQ+Jg=
8490
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251122131503-b76943960b6c/go.mod h1:+Me0raWPPdz8gRi9D4z1khmvUgS9vIKAVC8ckg1yJZU=
91+
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251103072528-9eb684fef4ef h1:Ql4G7sRHpqWFGwXypN7MorDGUWv4jz5n34ayzVt3R9E=
92+
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251103072528-9eb684fef4ef/go.mod h1:yf13jWb60XV26eA7A8o86ZCXNWBLNK9dPkTSWFaTPCw=
8593
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251122131503-b76943960b6c h1:dVIaDL5BeIdJjERGaN/XlcvZVplfkzh0uUfiVUHj/6Q=
8694
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251122131503-b76943960b6c/go.mod h1:fy1lvz3uuzzh01DKKdgroXvmJgMpJBsvl2r9eTtAll0=
8795
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

api/v1beta1/cinder_webhook.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"golang.org/x/exp/maps"
2828

2929
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
30+
keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
3031
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
3132
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
3233
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -96,6 +97,10 @@ func (r *Cinder) Default() {
9697
// This is required, as the loop variable is a by-value copy
9798
r.Spec.CinderVolumes[index] = cinderVolume
9899
}
100+
// Default ApplicationCredentialSecret to standard AC secret name if not specified
101+
if r.Spec.CinderAPI.Auth.ApplicationCredentialSecret == "" {
102+
r.Spec.CinderAPI.Auth.ApplicationCredentialSecret = keystonev1.GetACSecretName("cinder")
103+
}
99104
r.Spec.CinderSpecBase.Default()
100105
}
101106

api/v1beta1/cinderapi_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ type CinderAPITemplateCore struct {
4343
// +operator-sdk:csv:customresourcedefinitions:type=spec
4444
// TLS - Parameters related to the TLS
4545
TLS tls.API `json:"tls,omitempty"`
46+
47+
// +kubebuilder:validation:Optional
48+
// +operator-sdk:csv:customresourcedefinitions:type=spec
49+
// Auth - Parameters related to authentication
50+
Auth AuthSpec `json:"auth,omitempty"`
4651
}
4752

4853
// CinderAPITemplate defines the input parameters for the Cinder API service
@@ -61,6 +66,14 @@ type APIOverrideSpec struct {
6166
Service map[service.Endpoint]service.RoutedOverrideSpec `json:"service,omitempty"`
6267
}
6368

69+
// AuthSpec defines authentication parameters
70+
type AuthSpec struct {
71+
// +kubebuilder:validation:Optional
72+
// +operator-sdk:csv:customresourcedefinitions:type=spec
73+
// ApplicationCredentialSecret - Secret containing Application Credential ID and Secret
74+
ApplicationCredentialSecret string `json:"applicationCredentialSecret,omitempty"`
75+
}
76+
6477
// CinderAPISpec defines the desired state of CinderAPI
6578
type CinderAPISpec struct {
6679
// Common input parameters for all Cinder services

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cinder.openstack.org_cinderapis.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ spec:
5252
spec:
5353
description: CinderAPISpec defines the desired state of CinderAPI
5454
properties:
55+
auth:
56+
description: Auth - Parameters related to authentication
57+
properties:
58+
applicationCredentialSecret:
59+
description: ApplicationCredentialSecret - Secret containing Application
60+
Credential ID and Secret
61+
type: string
62+
type: object
5563
containerImage:
5664
description: ContainerImage - Cinder Container Image URL (will be
5765
set to environmental default if empty)

config/crd/bases/cinder.openstack.org_cinders.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ spec:
5757
description: CinderAPI - Spec definition for the API service of this
5858
Cinder deployment
5959
properties:
60+
auth:
61+
description: Auth - Parameters related to authentication
62+
properties:
63+
applicationCredentialSecret:
64+
description: ApplicationCredentialSecret - Secret containing
65+
Application Credential ID and Secret
66+
type: string
67+
type: object
6068
containerImage:
6169
description: ContainerImage - Cinder Container Image URL (will
6270
be set to environmental default if empty)

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,5 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.13 //allow-merging
143143
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20250929174222-a0d328fa4dec //allow-merging
144144

145145
replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250627150254-e9823e99808e //allow-merging
146+
147+
replace github.com/openstack-k8s-operators/keystone-operator/api => github.com/Deydra71/keystone-operator/api v0.0.0-20251211085602-3e1a3e022c81

0 commit comments

Comments
 (0)