Skip to content

Commit accf975

Browse files
committed
Merge branch 'main' into cloudkitty
2 parents 28dd366 + 1a33605 commit accf975

71 files changed

Lines changed: 3130 additions & 2109 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-openstack-operator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go_version: 1.24.x
1919
operator_sdk_version: 1.31.0
2020
bundle_dockerfile: ./bundle.Dockerfile
21+
operator_version: 0.4.0
2122
secrets:
2223
IMAGENAMESPACE: ${{ secrets.IMAGENAMESPACE }}
2324
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}

.github/workflows/catalog-openstack-operator-upgrades.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
name: Build catalog for OLM upgrade testing
22

33
on:
4+
5+
workflow_dispatch:
6+
branches:
7+
- '*'
8+
49
workflow_run:
510
workflows: ["openstack operator image builder"]
611
types:
712
- completed
13+
branches:
14+
- '*'
815
secrets:
916
IMAGENAMESPACE:
1017
required: true
@@ -25,8 +32,6 @@ env:
2532
jobs:
2633
build-catalog:
2734
runs-on: ubuntu-latest
28-
if: >
29-
github.event.workflow_run.conclusion == 'success'
3035

3136
steps:
3237
- name: Install Go
@@ -40,6 +45,15 @@ jobs:
4045
with:
4146
path: ./openstack-operator
4247

48+
- name: Get branch name
49+
id: branch-name
50+
uses: tj-actions/branch-names@v7
51+
52+
- name: Set latest tag for non main branch
53+
if: "${{ steps.branch-name.outputs.current_branch != 'main' }}"
54+
run: |
55+
echo "latesttag=${{ steps.branch-name.outputs.current_branch }}-latest" >> $GITHUB_ENV
56+
4357
- name: Install opm
4458
uses: redhat-actions/openshift-tools-installer@v1
4559
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ help: ## Display this help.
137137
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
138138
mkdir -p config/operator/rbac && \
139139
$(CONTROLLER_GEN) crd$(CRDDESC_OVERRIDE) output:crd:artifacts:config=config/crd/bases webhook paths="./..." && \
140-
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./apis/lightspeed/...,./apis/client/...,./apis/core/...,./apis/dataplane/...,./controllers/lightspeed/...,./controllers/client/...,./controllers/core/...,./controllers/dataplane/...,./pkg/...}" output:dir=config/rbac && \
140+
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./apis/client/...,./apis/core/...,./apis/dataplane/...,./controllers/client/...,./controllers/core/...,./controllers/dataplane/...,./pkg/...}" output:dir=config/rbac && \
141141
$(CONTROLLER_GEN) rbac:roleName=operator-role paths="./controllers/operator/..." paths="./apis/operator/..." output:dir=config/operator/rbac && \
142142
rm -f apis/bases/* && cp -a config/crd/bases apis/
143143

PROJECT

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,4 @@ resources:
8686
kind: OpenStack
8787
path: github.com/openstack-k8s-operators/openstack-operator/apis/operator/v1beta1
8888
version: v1beta1
89-
- api:
90-
crdVersion: v1
91-
namespaced: true
92-
controller: true
93-
domain: openstack.org
94-
group: lightspeed
95-
kind: OpenStackLightspeed
96-
path: github.com/openstack-k8s-operators/openstack-operator/apis/lightspeed/v1beta1
97-
version: v1beta1
9889
version: "3"

apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6586,6 +6586,13 @@ spec:
65866586
additionalProperties:
65876587
type: string
65886588
type: object
6589+
graphicalConsoles:
6590+
default: Disabled
6591+
enum:
6592+
- Enabled
6593+
- Disabled
6594+
- ""
6595+
type: string
65896596
ironicAPI:
65906597
properties:
65916598
customServiceConfig:
@@ -9855,6 +9862,8 @@ spec:
98559862
additionalProperties:
98569863
type: string
98579864
type: object
9865+
notificationsBusInstance:
9866+
type: string
98589867
nova:
98599868
properties:
98609869
apiOverride:
@@ -12056,6 +12065,24 @@ spec:
1205612065
properties:
1205712066
ovnController:
1205812067
properties:
12068+
bondConfiguration:
12069+
additionalProperties:
12070+
properties:
12071+
links:
12072+
default: []
12073+
items:
12074+
type: string
12075+
type: array
12076+
x-kubernetes-list-type: set
12077+
mode:
12078+
default: active-backup
12079+
type: string
12080+
mtu:
12081+
default: 1500
12082+
format: int32
12083+
type: integer
12084+
type: object
12085+
type: object
1205912086
external-ids:
1206012087
default: {}
1206112088
properties:
@@ -13244,7 +13271,7 @@ spec:
1324413271
rabbitmq:
1324513272
properties:
1324613273
additionalConfig:
13247-
maxLength: 2000
13274+
maxLength: 100000
1324813275
type: string
1324913276
additionalPlugins:
1325013277
items:
@@ -13356,6 +13383,10 @@ spec:
1335613383
- PreferDualStack
1335713384
- RequireDualStack
1335813385
type: string
13386+
labels:
13387+
additionalProperties:
13388+
type: string
13389+
type: object
1335913390
type:
1336013391
default: ClusterIP
1336113392
enum:

apis/bases/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

apis/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ type OpenStackControlPlaneSpec struct {
127127
// Rabbitmq - Parameters related to the Rabbitmq service
128128
Rabbitmq RabbitmqSection `json:"rabbitmq,omitempty"`
129129

130+
// +kubebuilder:validation:Optional
131+
// NotificationsBusInstance - the name of RabbitMQ Cluster CR to select a Messaging
132+
// Bus Service instance used by all services that produce or consume notifications.
133+
// Avoid colocating it with RabbitMQ services used for PRC.
134+
// That instance will be pushed down for services, unless overriden in templates.
135+
NotificationsBusInstance *string `json:"notificationsBusInstance,omitempty"`
136+
130137
// +kubebuilder:validation:Optional
131138
// +operator-sdk:csv:customresourcedefinitions:type=spec
132139
// Memcached - Parameters related to the Memcached service

apis/core/v1beta1/openstackcontrolplane_webhook.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ func (r *OpenStackControlPlane) ValidateCreate() (admission.Warnings, error) {
132132
allErrs = append(allErrs, err)
133133
}
134134

135+
if err := r.ValidateNotificationsBusInstance(basePath); err != nil {
136+
allErrs = append(allErrs, err)
137+
}
138+
135139
if len(allErrs) != 0 {
136140
return allWarn, apierrors.NewInvalid(
137141
schema.GroupKind{Group: "core.openstack.org", Kind: "OpenStackControlPlane"},
@@ -161,6 +165,10 @@ func (r *OpenStackControlPlane) ValidateUpdate(old runtime.Object) (admission.Wa
161165
allErrs = append(allErrs, err)
162166
}
163167

168+
if err := r.ValidateNotificationsBusInstance(basePath); err != nil {
169+
allErrs = append(allErrs, err)
170+
}
171+
164172
if len(allErrs) != 0 {
165173
return nil, apierrors.NewInvalid(
166174
schema.GroupKind{Group: "core.openstack.org", Kind: "OpenStackControlPlane"},
@@ -361,6 +369,13 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
361369
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Watcher.APIOverride.Route, basePath.Child("watcher").Child("apiOverride").Child("route"))...)
362370
}
363371

372+
if r.Spec.Telemetry.Enabled {
373+
errors = append(errors, r.Spec.Telemetry.Template.ValidateCreate(basePath.Child("telemetry").Child("template"), r.Namespace)...)
374+
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Telemetry.AodhAPIOverride.Route, basePath.Child("telemetry").Child("aodhApiOverride").Child("route"))...)
375+
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Telemetry.PrometheusOverride.Route, basePath.Child("telemetry").Child("prometheusOverride").Child("route"))...)
376+
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Telemetry.AlertmanagerOverride.Route, basePath.Child("telemetry").Child("alertmanagerOverride").Child("route"))...)
377+
}
378+
364379
// Validation for remaining services...
365380
if r.Spec.Galera.Enabled {
366381
for key, s := range *r.Spec.Galera.Templates {
@@ -556,6 +571,15 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
556571
errors = append(errors, r.Spec.Watcher.Template.ValidateUpdate(*old.Watcher.Template, basePath.Child("watcher").Child("template"), r.Namespace)...)
557572
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Watcher.APIOverride.Route, basePath.Child("watcher").Child("apiOverride").Child("route"))...)
558573
}
574+
if r.Spec.Telemetry.Enabled {
575+
if old.Telemetry.Template == nil {
576+
old.Telemetry.Template = &telemetryv1.TelemetrySpecCore{}
577+
}
578+
errors = append(errors, r.Spec.Telemetry.Template.ValidateUpdate(*old.Telemetry.Template, basePath.Child("telemetry").Child("template"), r.Namespace)...)
579+
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Telemetry.AodhAPIOverride.Route, basePath.Child("telemetry").Child("aodhApiOverride").Child("route"))...)
580+
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Telemetry.PrometheusOverride.Route, basePath.Child("telemetry").Child("prometheusOverride").Child("route"))...)
581+
errors = append(errors, validateTLSOverrideSpec(&r.Spec.Telemetry.AlertmanagerOverride.Route, basePath.Child("telemetry").Child("alertmanagerOverride").Child("route"))...)
582+
}
559583

560584
if r.Spec.Memcached.Enabled {
561585
if r.Spec.Memcached.Templates != nil {
@@ -1142,3 +1166,28 @@ func (r *OpenStackControlPlane) ValidateTopology(basePath *field.Path) *field.Er
11421166
}
11431167
return nil
11441168
}
1169+
1170+
// ValidateNotificationsBusInstance - returns an error if the notificationsBusInstance
1171+
// parameter is not valid.
1172+
// - nil or empty string must be raised as an error
1173+
// - when notificationsBusInstance does not point to an existing RabbitMQ instance
1174+
func (r *OpenStackControlPlane) ValidateNotificationsBusInstance(basePath *field.Path) *field.Error {
1175+
notificationsField := basePath.Child("notificationsBusInstance")
1176+
// no notificationsBusInstance field set, nothing to validate here
1177+
if r.Spec.NotificationsBusInstance == nil {
1178+
return nil
1179+
}
1180+
// When NotificationsBusInstance is set, fail if it is an empty string
1181+
if *r.Spec.NotificationsBusInstance == "" {
1182+
return field.Invalid(notificationsField, *r.Spec.NotificationsBusInstance, "notificationsBusInstance is not a valid string")
1183+
}
1184+
// NotificationsBusInstance is set and must be equal to an existing
1185+
// deployed rabbitmq instance, otherwise we should fail because it
1186+
// does not represent a valid string
1187+
for k := range(*r.Spec.Rabbitmq.Templates) {
1188+
if *r.Spec.NotificationsBusInstance == k {
1189+
return nil
1190+
}
1191+
}
1192+
return field.Invalid(notificationsField, *r.Spec.NotificationsBusInstance, "notificationsBusInstance must match an existing RabbitMQ instance name")
1193+
}

0 commit comments

Comments
 (0)