Skip to content

Commit 373d024

Browse files
Deydra71xek
authored andcommitted
Application Credential support
1 parent 0cf3ce8 commit 373d024

14 files changed

Lines changed: 249 additions & 12 deletions

api/bases/glance.openstack.org_glanceapis.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ spec:
6565
- single
6666
- edge
6767
type: string
68+
auth:
69+
description: Auth - Parameters related to authentication
70+
properties:
71+
applicationCredentialSecret:
72+
description: ApplicationCredentialSecret - Secret containing Application
73+
Credential ID and Secret
74+
type: string
75+
type: object
6876
containerImage:
6977
description: ContainerImage - GlanceAPI Container Image URL
7078
type: string

api/bases/glance.openstack.org_glances.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,14 @@ spec:
12291229
APITimeout
12301230
minimum: 1
12311231
type: integer
1232+
auth:
1233+
description: Auth - Parameters related to authentication
1234+
properties:
1235+
applicationCredentialSecret:
1236+
description: ApplicationCredentialSecret - Secret containing
1237+
Application Credential ID and Secret
1238+
type: string
1239+
type: object
12321240
customServiceConfig:
12331241
description: |-
12341242
CustomServiceConfig - customize the service config using this parameter to change service defaults,

api/v1beta1/common_types.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ package v1beta1
1919
import (
2020
"strings"
2121

22+
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2223
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
2324
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
2425
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
25-
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
26-
"k8s.io/apimachinery/pkg/util/validation/field"
2726
corev1 "k8s.io/api/core/v1"
27+
"k8s.io/apimachinery/pkg/util/validation/field"
2828
)
2929

3030
const (
@@ -100,6 +100,11 @@ type GlanceAPITemplate struct {
100100
// TLS - Parameters related to the TLS
101101
TLS tls.API `json:"tls,omitempty"`
102102

103+
// +kubebuilder:validation:Optional
104+
// +operator-sdk:csv:customresourcedefinitions:type=spec
105+
// Auth - Parameters related to authentication
106+
Auth AuthSpec `json:"auth,omitempty"`
107+
103108
// ImageCache - It represents the struct to expose the ImageCache related
104109
// parameters (size of the PVC and cronJob schedule)
105110
// +kubebuilder:validation:Optional
@@ -147,6 +152,14 @@ type APIOverrideSpec struct {
147152
Service map[service.Endpoint]service.RoutedOverrideSpec `json:"service,omitempty"`
148153
}
149154

155+
// AuthSpec defines authentication parameters
156+
type AuthSpec struct {
157+
// +kubebuilder:validation:Optional
158+
// +operator-sdk:csv:customresourcedefinitions:type=spec
159+
// ApplicationCredentialSecret - Secret containing Application Credential ID and Secret
160+
ApplicationCredentialSecret string `json:"applicationCredentialSecret,omitempty"`
161+
}
162+
150163
// SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)
151164
func SetupDefaults() {
152165
// Acquire environmental defaults and initialize Glance defaults with them

api/v1beta1/glance_webhook.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"strings"
2222

2323
"github.com/google/go-cmp/cmp"
24+
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2425
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
2526
apierrors "k8s.io/apimachinery/pkg/api/errors"
2627
"k8s.io/apimachinery/pkg/runtime"
@@ -29,7 +30,6 @@ import (
2930
logf "sigs.k8s.io/controller-runtime/pkg/log"
3031
"sigs.k8s.io/controller-runtime/pkg/webhook"
3132
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
32-
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
3333

3434
common_webhook "github.com/openstack-k8s-operators/lib-common/modules/common/webhook"
3535
)
@@ -157,7 +157,6 @@ func (r *GlanceSpecCore) Default() {
157157
}
158158
}
159159

160-
161160
// Check if File is used as a backend for Glance
162161
func isFileBackend(customServiceConfig string, topLevel bool) bool {
163162
availableBackends := GetEnabledBackends(customServiceConfig)

api/v1beta1/glanceapi_webhook.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
"fmt"
21+
22+
"github.com/google/go-cmp/cmp"
23+
apierrors "k8s.io/apimachinery/pkg/api/errors"
2024
"k8s.io/apimachinery/pkg/runtime"
2125
logf "sigs.k8s.io/controller-runtime/pkg/log"
2226
"sigs.k8s.io/controller-runtime/pkg/webhook"
23-
"fmt"
2427
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
25-
"github.com/google/go-cmp/cmp"
26-
apierrors "k8s.io/apimachinery/pkg/api/errors"
2728
)
2829

2930
// GlanceAPIDefaults -

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/glance.openstack.org_glanceapis.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ spec:
6565
- single
6666
- edge
6767
type: string
68+
auth:
69+
description: Auth - Parameters related to authentication
70+
properties:
71+
applicationCredentialSecret:
72+
description: ApplicationCredentialSecret - Secret containing Application
73+
Credential ID and Secret
74+
type: string
75+
type: object
6876
containerImage:
6977
description: ContainerImage - GlanceAPI Container Image URL
7078
type: string

config/crd/bases/glance.openstack.org_glances.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,14 @@ spec:
12291229
APITimeout
12301230
minimum: 1
12311231
type: integer
1232+
auth:
1233+
description: Auth - Parameters related to authentication
1234+
properties:
1235+
applicationCredentialSecret:
1236+
description: ApplicationCredentialSecret - Secret containing
1237+
Application Credential ID and Secret
1238+
type: string
1239+
type: object
12321240
customServiceConfig:
12331241
description: |-
12341242
CustomServiceConfig - customize the service config using this parameter to change service defaults,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/openstack-k8s-operators/glance-operator/api v0.0.0-00010101000000-000000000000
1414
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260111154931-be9fdcb15911
1515
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260115124008-0121df869109
16-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260116230254-f54dd51650ac
16+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260120112029-cd452f0497ba
1717
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35
1818
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251230215914-6ba873b49a35
1919
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20251230215914-6ba873b49a35

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260111154931-
124124
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20260111154931-be9fdcb15911/go.mod h1:j4xehAICMmNT/2VnRcOToMHZA9/Nj0SsiyETceUK7Pc=
125125
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260115124008-0121df869109 h1:S+A67nntHZrL1lIL3qr91CpJj+A67M/G4t1cTKzeGdo=
126126
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260115124008-0121df869109/go.mod h1:ZXwFlspJCdZEUjMbmaf61t5AMB4u2vMyAMMoe/vJroE=
127-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260116230254-f54dd51650ac h1:DZ/Cw3l4fQXTu2O78HAPIEhSYYZ7cR+QZv893Z+gvNU=
128-
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260116230254-f54dd51650ac/go.mod h1:xqvebn9DqLavxp2z8Rz/7i1S6M9MJhxmZVHC+S1uHX0=
127+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260120112029-cd452f0497ba h1:4VaDkZFawGCkzwvfijnFLz0Gduxh17buj9fIwk0WULo=
128+
github.com/openstack-k8s-operators/keystone-operator/api v0.6.1-0.20260120112029-cd452f0497ba/go.mod h1:xqvebn9DqLavxp2z8Rz/7i1S6M9MJhxmZVHC+S1uHX0=
129129
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35 h1:pF3mJ3nwq6r4qwom+rEWZNquZpcQW/iftHlJ1KPIDsk=
130130
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20251230215914-6ba873b49a35/go.mod h1:kycZyoe7OZdW1HUghr2nI3N7wSJtNahXf6b/ypD14f4=
131131
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.6.1-0.20251230215914-6ba873b49a35 h1:IdcI8DFvW8rXtchONSzbDmhhRp1YyO2YaBJDBXr44Gk=

0 commit comments

Comments
 (0)