Skip to content

Commit e256324

Browse files
Deydra71cursoragent
authored andcommitted
Application Credential Support
Co-authored-by: Cursor <[email protected]>
1 parent 970a86e commit e256324

27 files changed

+1113
-8
lines changed

OWNERS_ALIASES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ aliases:
1515
openstack-approvers:
1616
- abays
1717
- dprince
18-
- olliewalsh
1918
- stuggi

api/bases/watcher.openstack.org_watchers.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,15 @@ spec:
460460
type: string
461461
type: object
462462
type: object
463+
auth:
464+
description: Auth - Parameters related to authentication (shared by
465+
all Watcher components)
466+
properties:
467+
applicationCredentialSecret:
468+
description: ApplicationCredentialSecret - Secret containing Application
469+
Credential ID and Secret
470+
type: string
471+
type: object
463472
customServiceConfig:
464473
description: |-
465474
CustomServiceConfig - customize the service config using this parameter to change service defaults,

api/v1beta1/common_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ type WatcherSpecCore struct {
129129
// APITimeout for Route and Apache
130130
APITimeout *int `json:"apiTimeout"`
131131

132+
// +kubebuilder:validation:Optional
133+
// +operator-sdk:csv:customresourcedefinitions:type=spec
134+
// Auth - Parameters related to authentication (shared by all Watcher components)
135+
Auth AuthSpec `json:"auth,omitempty"`
136+
132137
// +kubebuilder:validation:Optional
133138
// NotificationsBusInstance is the name of the RabbitMqCluster CR to select
134139
// the Message Bus Service instance used by the Watcher service to publish and consume notifications
@@ -139,6 +144,14 @@ type WatcherSpecCore struct {
139144
NotificationsBusInstance *string `json:"notificationsBusInstance,omitempty"`
140145
}
141146

147+
// AuthSpec defines authentication parameters
148+
type AuthSpec struct {
149+
// +kubebuilder:validation:Optional
150+
// +operator-sdk:csv:customresourcedefinitions:type=spec
151+
// ApplicationCredentialSecret - Secret containing Application Credential ID and Secret
152+
ApplicationCredentialSecret string `json:"applicationCredentialSecret,omitempty"`
153+
}
154+
142155
// PasswordSelector to identify the DB and AdminUser password from the Secret
143156
type PasswordSelector struct {
144157
// +kubebuilder:validation:Optional

api/v1beta1/conditions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const (
3838
WatcherAPIReadyErrorMessage = "WatcherAPI error occured %s"
3939
// WatcherPrometheusSecretErrorMessage -
4040
WatcherPrometheusSecretErrorMessage = "Error with prometheus config secret"
41+
// WatcherApplicationCredentialSecretErrorMessage -
42+
WatcherApplicationCredentialSecretErrorMessage = "Error with application credential secret"
4143
// WatcherApplierReadyInitMessage -
4244
WatcherApplierReadyInitMessage = "WatcherApplier creation not started"
4345
// WatcherApplierReadyRunningMessage -

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/watcher.openstack.org_watchers.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,15 @@ spec:
460460
type: string
461461
type: object
462462
type: object
463+
auth:
464+
description: Auth - Parameters related to authentication (shared by
465+
all Watcher components)
466+
properties:
467+
applicationCredentialSecret:
468+
description: ApplicationCredentialSecret - Secret containing Application
469+
Credential ID and Secret
470+
type: string
471+
type: object
463472
customServiceConfig:
464473
description: |-
465474
CustomServiceConfig - customize the service config using this parameter to change service defaults,

config/manifests/bases/watcher-operator.clusterserviceversion.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ spec:
5757
- description: TLS - Parameters related to the TLS
5858
displayName: TLS
5959
path: apiServiceTemplate.tls
60+
- description: Auth - Parameters related to authentication (shared by all Watcher
61+
components)
62+
displayName: Auth
63+
path: auth
64+
- description: ApplicationCredentialSecret - Secret containing Application Credential
65+
ID and Secret
66+
displayName: Application Credential Secret
67+
path: auth.applicationCredentialSecret
6068
version: v1beta1
6169
description: The Watcher Operator project
6270
displayName: Watcher Operator

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/onsi/gomega v1.39.0
1010
github.com/openshift/api v3.9.0+incompatible
1111
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260115124008-0121df869109
12-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260116230254-f54dd51650ac
12+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260120112029-cd452f0497ba
1313
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35
1414
github.com/openstack-k8s-operators/lib-common/modules/test v0.6.1-0.20251230215914-6ba873b49a35
1515
github.com/openstack-k8s-operators/mariadb-operator/api v0.6.1-0.20260105160121-f7a8ef85ce8d

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e h1:E1OdwSpqWuDPCedyU
120120
github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo=
121121
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260115124008-0121df869109 h1:S+A67nntHZrL1lIL3qr91CpJj+A67M/G4t1cTKzeGdo=
122122
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260115124008-0121df869109/go.mod h1:ZXwFlspJCdZEUjMbmaf61t5AMB4u2vMyAMMoe/vJroE=
123-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260116230254-f54dd51650ac h1:DZ/Cw3l4fQXTu2O78HAPIEhSYYZ7cR+QZv893Z+gvNU=
124-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260116230254-f54dd51650ac/go.mod h1:xqvebn9DqLavxp2z8Rz/7i1S6M9MJhxmZVHC+S1uHX0=
123+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260120112029-cd452f0497ba h1:4VaDkZFawGCkzwvfijnFLz0Gduxh17buj9fIwk0WULo=
124+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260120112029-cd452f0497ba/go.mod h1:xqvebn9DqLavxp2z8Rz/7i1S6M9MJhxmZVHC+S1uHX0=
125125
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35 h1:pF3mJ3nwq6r4qwom+rEWZNquZpcQW/iftHlJ1KPIDsk=
126126
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35/go.mod h1:kycZyoe7OZdW1HUghr2nI3N7wSJtNahXf6b/ypD14f4=
127127
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251230215914-6ba873b49a35 h1:IdcI8DFvW8rXtchONSzbDmhhRp1YyO2YaBJDBXr44Gk=

internal/controller/watcher_common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const (
3636
tlsAPIPublicField = ".spec.tls.api.public.secretName"
3737
topologyField = ".spec.topologyRef.Name"
3838
memcachedInstanceField = ".spec.memcachedInstance"
39+
authAppCredSecretField = ".spec.auth.applicationCredentialSecret" //nolint:gosec // G101: Not actual credentials, just field path
3940
// service label for cinder endpoint
4041
endpointCinder = "cinder"
4142
)
@@ -60,6 +61,7 @@ var (
6061
watcherWatchFields = []string{
6162
passwordSecretField,
6263
prometheusSecretField,
64+
authAppCredSecretField,
6365
}
6466
decisionEngineWatchFields = []string{
6567
passwordSecretField,

0 commit comments

Comments
 (0)