Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apis/bases/core.openstack.org_openstackversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ spec:
type: object
status:
properties:
availableServiceDefaults:
additionalProperties:
properties:
glanceWsgi:
type: string
type: object
type: object
availableVersion:
type: string
conditions:
Expand Down Expand Up @@ -638,6 +645,11 @@ spec:
observedGeneration:
format: int64
type: integer
serviceDefaults:
properties:
glanceWsgi:
type: string
type: object
type: object
type: object
served: true
Expand Down
12 changes: 12 additions & 0 deletions apis/core/v1beta1/openstackversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ type ContainerTemplate struct {
TestAnsibletestImage *string `json:"testAnsibletestImage,omitempty"`
}

// ServiceDefaults - struct that contains defaults for OSP services that can change over time
// but are associated with a specific OpenStack release version
type ServiceDefaults struct {
GlanceWsgi *string `json:"glanceWsgi,omitempty"`
}

// OpenStackVersionStatus defines the observed state of OpenStackVersion
type OpenStackVersionStatus struct {
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
Expand All @@ -179,6 +185,12 @@ type OpenStackVersionStatus struct {
// where we keep track of the container images for previous versions
ContainerImageVersionDefaults map[string]*ContainerDefaults `json:"containerImageVersionDefaults,omitempty"`

// AvailableServiceDefaults - struct that contains defaults for OSP services for each discovered available version
AvailableServiceDefaults map[string]*ServiceDefaults `json:"availableServiceDefaults,omitempty"`

// ServiceDefaults - struct that contains current defaults for OSP services
ServiceDefaults ServiceDefaults `json:"serviceDefaults,omitempty"`
Comment thread
dprince marked this conversation as resolved.

//ObservedGeneration - the most recent generation observed for this object.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
Expand Down
37 changes: 37 additions & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20250506130536-223f7d6134c0
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250509194427-81d3a41eb9ca
Expand Down
4 changes: 2 additions & 2 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3/go.mod h1:xwwIYSaH1j3kHeBx6QzNQtr9Os8eizorNfExk1ogofs=
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85 h1:cQxDpoiY2NsFycMHqT7gH44TDuD+X8Aq2robpM00HQU=
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85/go.mod h1:koOkgiyBGqXerPKPNT6XUfjWiERro5kRCmBmxuWAP4s=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d h1:DivsLnqDoMFnAWOOkOCoj9ilCM+6pFXRjvz4fSFSvJw=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d/go.mod h1:IRp2nEGLIQj9gZSc5aMJr5Wec9yBhr//6y7W41ur4KQ=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c h1:gacCXyPW1ByJIh1hm8C3o2Um05n87GeyULz4vySsCt0=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c/go.mod h1:cYKwcqIKJpNbjX7OebCnBWP1Fu8PfhTNqM4oeqMyrfI=
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7 h1:vLbhKM15HVSgvL5KHARwRjKSYu4GdyQfPHNpvXLqip8=
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7/go.mod h1:Wzn7+VSmDiwGy7kNPc9Adva/BX5lcYzfEUFigHBFUnA=
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea h1:Jv8YX0NinuYNJWO4YQQo2UsHBwMsNG2WPBT5lE2BlUM=
Expand Down
12 changes: 12 additions & 0 deletions bindata/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19896,6 +19896,13 @@ spec:
type: object
status:
properties:
availableServiceDefaults:
additionalProperties:
properties:
glanceWsgi:
type: string
type: object
type: object
availableVersion:
type: string
conditions:
Expand Down Expand Up @@ -20301,6 +20308,11 @@ spec:
observedGeneration:
format: int64
type: integer
serviceDefaults:
properties:
glanceWsgi:
type: string
type: object
type: object
type: object
served: true
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/core.openstack.org_openstackversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ spec:
type: object
status:
properties:
availableServiceDefaults:
additionalProperties:
properties:
glanceWsgi:
type: string
type: object
type: object
availableVersion:
type: string
conditions:
Expand Down Expand Up @@ -638,6 +645,11 @@ spec:
observedGeneration:
format: int64
type: integer
serviceDefaults:
properties:
glanceWsgi:
type: string
type: object
type: object
type: object
served: true
Expand Down
2 changes: 1 addition & 1 deletion config/operator/manager_operator_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
- name: RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL
value: quay.io/openstack-k8s-operators/designate-operator@sha256:317bcf7b4e65abdff6fdf94b4c741986ac74559484a9eb6bd4d422190533dacc
- name: RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL
value: quay.io/openstack-k8s-operators/glance-operator@sha256:1ed34422907d48c5518baf3f7465eb1955b8c8e6ea077dc785584e4d9e7f5cb0
value: quay.io/openstack-k8s-operators/glance-operator@sha256:11b14c96f58239fcffb76a01be36e90b947d6a109d46895f2007f691142e1751
- name: RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL
value: quay.io/openstack-k8s-operators/heat-operator@sha256:0a8093395bed266301649ebbc9de6c3bd5381fd9aba5a586a6a6bb01bf24ef37
- name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL
Expand Down
15 changes: 15 additions & 0 deletions controllers/core/openstackversion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req
}
instance.Status.ContainerImages = openstack.GetContainerImages(val, *instance)

// initialize service defaults
serviceDefaults := openstack.InitializeOpenStackVersionServiceDefaults(ctx)
if instance.Status.AvailableServiceDefaults == nil {
instance.Status.AvailableServiceDefaults = make(map[string]*corev1beta1.ServiceDefaults)
}
// store the service defaults for the currently available version
instance.Status.AvailableServiceDefaults[envAvailableVersion] = serviceDefaults

serviceDefVal, ok := instance.Status.AvailableServiceDefaults[instance.Spec.TargetVersion]
if !ok {
instance.Status.ServiceDefaults = corev1beta1.ServiceDefaults{}
} else {
instance.Status.ServiceDefaults = *serviceDefVal
}

instance.Status.Conditions.MarkTrue(
corev1beta1.OpenStackVersionInitialized,
corev1beta1.OpenStackVersionInitializedReadyMessage)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/openstack-k8s-operators/barbican-operator/api v0.6.1-0.20250506130536-223f7d6134c0
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250509194427-81d3a41eb9ca
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9
github.com/openstack-k8s-operators/cinder-operator/api v0.6.1-0.20250429124558-9bd7e7d196d3/go.mod h1:xwwIYSaH1j3kHeBx6QzNQtr9Os8eizorNfExk1ogofs=
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85 h1:cQxDpoiY2NsFycMHqT7gH44TDuD+X8Aq2robpM00HQU=
github.com/openstack-k8s-operators/designate-operator/api v0.6.1-0.20250429111658-47223f655c85/go.mod h1:koOkgiyBGqXerPKPNT6XUfjWiERro5kRCmBmxuWAP4s=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d h1:DivsLnqDoMFnAWOOkOCoj9ilCM+6pFXRjvz4fSFSvJw=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250407064150-1cff0f51b44d/go.mod h1:IRp2nEGLIQj9gZSc5aMJr5Wec9yBhr//6y7W41ur4KQ=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c h1:gacCXyPW1ByJIh1hm8C3o2Um05n87GeyULz4vySsCt0=
github.com/openstack-k8s-operators/glance-operator/api v0.6.1-0.20250514134204-2f79e310a53c/go.mod h1:cYKwcqIKJpNbjX7OebCnBWP1Fu8PfhTNqM4oeqMyrfI=
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7 h1:vLbhKM15HVSgvL5KHARwRjKSYu4GdyQfPHNpvXLqip8=
github.com/openstack-k8s-operators/heat-operator/api v0.6.1-0.20250509023421-ae77c00926c7/go.mod h1:Wzn7+VSmDiwGy7kNPc9Adva/BX5lcYzfEUFigHBFUnA=
github.com/openstack-k8s-operators/horizon-operator/api v0.6.1-0.20250509022835-28d7c16c3cea h1:Jv8YX0NinuYNJWO4YQQo2UsHBwMsNG2WPBT5lE2BlUM=
Expand Down
2 changes: 1 addition & 1 deletion hack/export_operator_related_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export RELATED_IMAGE_BARBICAN_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/barbican-operator@sha256:d2516918f0e9133290106628b9945b4dadf7c6482ece3b6f575af8078e6a9a68
export RELATED_IMAGE_CINDER_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/cinder-operator@sha256:d782a65dca4852eb3cc176f3da11bf464e95e07742f069a46fbb648d481e2c96
export RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/designate-operator@sha256:317bcf7b4e65abdff6fdf94b4c741986ac74559484a9eb6bd4d422190533dacc
export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:1ed34422907d48c5518baf3f7465eb1955b8c8e6ea077dc785584e4d9e7f5cb0
export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:11b14c96f58239fcffb76a01be36e90b947d6a109d46895f2007f691142e1751
export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/heat-operator@sha256:0a8093395bed266301649ebbc9de6c3bd5381fd9aba5a586a6a6bb01bf24ef37
export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:d88e067f5f6e0a0dbfbcea10dea9ca8073d9d3ad47c616e9c7fe02c423d27b42
export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/infra-operator@sha256:6ee778de1434ace4e47647a3a27e137d5b1828e18d4736edb3bcd40873809f0f
Expand Down
10 changes: 10 additions & 0 deletions pkg/openstack/glance.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl
if glance.Spec.Storage.StorageClass == "" {
glance.Spec.Storage.StorageClass = instance.Spec.StorageClass
}

if glance.GetAnnotations() == nil {
glance.SetAnnotations(make(map[string]string))
}
if version.Status.ServiceDefaults.GlanceWsgi != nil && *version.Status.ServiceDefaults.GlanceWsgi == "true" {
Comment thread
dprince marked this conversation as resolved.
glance.GetAnnotations()[glancev1.GlanceWSGILabel] = "true"
} else {
glance.GetAnnotations()[glancev1.GlanceWSGILabel] = "false"
}

// Append globally defined extraMounts to the service's own list.
for _, ev := range instance.Spec.ExtraMounts {
glance.Spec.ExtraMounts = append(glance.Spec.ExtraMounts, glancev1.GlanceExtraVolMounts{
Expand Down
16 changes: 16 additions & 0 deletions pkg/openstack/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,22 @@ func GetContainerImages(defaults *corev1beta1.ContainerDefaults, instance corev1
return containerImages
}

// InitializeOpenStackVersionImageDefaults - initializes OpenStackVersion CR with default container images
func InitializeOpenStackVersionServiceDefaults(ctx context.Context) *corev1beta1.ServiceDefaults {
Log := GetLogger(ctx)
Log.Info("Initialize OpenStackVersion Service Defaults")

defaults := &corev1beta1.ServiceDefaults{}

// NOTE: defaults change over time, older OpenStackVersion defaults would default to false (FR2 for example),
// but get set to true here for FR3 available versions and thus provide a way for services to migrate
// to new deployment topologies
trueString := "true"
defaults.GlanceWsgi = &trueString // all new glance deployments use WSGI by default (FR3 and later)

return defaults
}

// ReconcileVersion - reconciles OpenStackVersion CR
func ReconcileVersion(ctx context.Context, instance *corev1beta1.OpenStackControlPlane, helper *helper.Helper) (ctrl.Result, *corev1beta1.OpenStackVersion, error) {
version := &corev1beta1.OpenStackVersion{
Expand Down