Skip to content

Commit f2575be

Browse files
Merge pull request #1439 from dprince/serviceDefaults
Add ServiceDefaults mechanism for updates support
2 parents a5ee4b8 + 4e3c854 commit f2575be

14 files changed

Lines changed: 134 additions & 8 deletions

apis/bases/core.openstack.org_openstackversions.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ spec:
233233
type: object
234234
status:
235235
properties:
236+
availableServiceDefaults:
237+
additionalProperties:
238+
properties:
239+
glanceWsgi:
240+
type: string
241+
type: object
242+
type: object
236243
availableVersion:
237244
type: string
238245
conditions:
@@ -638,6 +645,11 @@ spec:
638645
observedGeneration:
639646
format: int64
640647
type: integer
648+
serviceDefaults:
649+
properties:
650+
glanceWsgi:
651+
type: string
652+
type: object
641653
type: object
642654
type: object
643655
served: true

apis/core/v1beta1/openstackversion_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ type ContainerTemplate struct {
164164
TestAnsibletestImage *string `json:"testAnsibletestImage,omitempty"`
165165
}
166166

167+
// ServiceDefaults - struct that contains defaults for OSP services that can change over time
168+
// but are associated with a specific OpenStack release version
169+
type ServiceDefaults struct {
170+
GlanceWsgi *string `json:"glanceWsgi,omitempty"`
171+
}
172+
167173
// OpenStackVersionStatus defines the observed state of OpenStackVersion
168174
type OpenStackVersionStatus struct {
169175
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
@@ -179,6 +185,12 @@ type OpenStackVersionStatus struct {
179185
// where we keep track of the container images for previous versions
180186
ContainerImageVersionDefaults map[string]*ContainerDefaults `json:"containerImageVersionDefaults,omitempty"`
181187

188+
// AvailableServiceDefaults - struct that contains defaults for OSP services for each discovered available version
189+
AvailableServiceDefaults map[string]*ServiceDefaults `json:"availableServiceDefaults,omitempty"`
190+
191+
// ServiceDefaults - struct that contains current defaults for OSP services
192+
ServiceDefaults ServiceDefaults `json:"serviceDefaults,omitempty"`
193+
182194
//ObservedGeneration - the most recent generation observed for this object.
183195
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
184196
}

apis/core/v1beta1/zz_generated.deepcopy.go

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

apis/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20250506130536-223f7d6134c0
1111
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3
1212
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85
13-
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d
13+
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c
1414
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7
1515
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea
1616
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250512104855-47f817ef8ff8

apis/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9
100100
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3/go.mod h1:xwwIYSaH1j3kHeBx6QzNQtr9Os8eizorNfExk1ogofs=
101101
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85 h1:cQxDpoiY2NsFycMHqT7gH44TDuD+X8Aq2robpM00HQU=
102102
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85/go.mod h1:koOkgiyBGqXerPKPNT6XUfjWiERro5kRCmBmxuWAP4s=
103-
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d h1:DivsLnqDoMFnAWOOkOCoj9ilCM+6pFXRjvz4fSFSvJw=
104-
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d/go.mod h1:IRp2nEGLIQj9gZSc5aMJr5Wec9yBhr//6y7W41ur4KQ=
103+
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c h1:gacCXyPW1ByJIh1hm8C3o2Um05n87GeyULz4vySsCt0=
104+
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c/go.mod h1:cYKwcqIKJpNbjX7OebCnBWP1Fu8PfhTNqM4oeqMyrfI=
105105
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7 h1:vLbhKM15HVSgvL5KHARwRjKSYu4GdyQfPHNpvXLqip8=
106106
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7/go.mod h1:Wzn7+VSmDiwGy7kNPc9Adva/BX5lcYzfEUFigHBFUnA=
107107
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea h1:Jv8YX0NinuYNJWO4YQQo2UsHBwMsNG2WPBT5lE2BlUM=

bindata/crds/crds.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19896,6 +19896,13 @@ spec:
1989619896
type: object
1989719897
status:
1989819898
properties:
19899+
availableServiceDefaults:
19900+
additionalProperties:
19901+
properties:
19902+
glanceWsgi:
19903+
type: string
19904+
type: object
19905+
type: object
1989919906
availableVersion:
1990019907
type: string
1990119908
conditions:
@@ -20301,6 +20308,11 @@ spec:
2030120308
observedGeneration:
2030220309
format: int64
2030320310
type: integer
20311+
serviceDefaults:
20312+
properties:
20313+
glanceWsgi:
20314+
type: string
20315+
type: object
2030420316
type: object
2030520317
type: object
2030620318
served: true

config/crd/bases/core.openstack.org_openstackversions.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ spec:
233233
type: object
234234
status:
235235
properties:
236+
availableServiceDefaults:
237+
additionalProperties:
238+
properties:
239+
glanceWsgi:
240+
type: string
241+
type: object
242+
type: object
236243
availableVersion:
237244
type: string
238245
conditions:
@@ -638,6 +645,11 @@ spec:
638645
observedGeneration:
639646
format: int64
640647
type: integer
648+
serviceDefaults:
649+
properties:
650+
glanceWsgi:
651+
type: string
652+
type: object
641653
type: object
642654
type: object
643655
served: true

config/operator/manager_operator_images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
- name: RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL
2121
value: quay.io/openstack-k8s-operators/designate-operator@sha256:317bcf7b4e65abdff6fdf94b4c741986ac74559484a9eb6bd4d422190533dacc
2222
- name: RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL
23-
value: quay.io/openstack-k8s-operators/glance-operator@sha256:1ed34422907d48c5518baf3f7465eb1955b8c8e6ea077dc785584e4d9e7f5cb0
23+
value: quay.io/openstack-k8s-operators/glance-operator@sha256:11b14c96f58239fcffb76a01be36e90b947d6a109d46895f2007f691142e1751
2424
- name: RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL
2525
value: quay.io/openstack-k8s-operators/heat-operator@sha256:0a8093395bed266301649ebbc9de6c3bd5381fd9aba5a586a6a6bb01bf24ef37
2626
- name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL

controllers/core/openstackversion_controller.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,21 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req
200200
}
201201
instance.Status.ContainerImages = openstack.GetContainerImages(val, *instance)
202202

203+
// initialize service defaults
204+
serviceDefaults := openstack.InitializeOpenStackVersionServiceDefaults(ctx)
205+
if instance.Status.AvailableServiceDefaults == nil {
206+
instance.Status.AvailableServiceDefaults = make(map[string]*corev1beta1.ServiceDefaults)
207+
}
208+
// store the service defaults for the currently available version
209+
instance.Status.AvailableServiceDefaults[envAvailableVersion] = serviceDefaults
210+
211+
serviceDefVal, ok := instance.Status.AvailableServiceDefaults[instance.Spec.TargetVersion]
212+
if !ok {
213+
instance.Status.ServiceDefaults = corev1beta1.ServiceDefaults{}
214+
} else {
215+
instance.Status.ServiceDefaults = *serviceDefVal
216+
}
217+
203218
instance.Status.Conditions.MarkTrue(
204219
corev1beta1.OpenStackVersionInitialized,
205220
corev1beta1.OpenStackVersionInitializedReadyMessage)

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/barbican-operator/api v0.6.1-0.20250506130536-223f7d6134c0
1616
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3
1717
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85
18-
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d
18+
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c
1919
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7
2020
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea
2121
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250512104855-47f817ef8ff8

0 commit comments

Comments
 (0)