Skip to content

Commit c575719

Browse files
authored
Merge branch 'openstack-k8s-operators:main' into dashboard-ipmi
2 parents 1742293 + 0442a3d commit c575719

30 files changed

+832
-599
lines changed

OWNERS_ALIASES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ aliases:
44
telemetry-approvers:
55
- elfiesmelfie
66
- jlarriba
7+
- mgirgisf
78
- paramite
89
- vyzigold
9-
- yadneshk
1010
ci-approvers:
1111
- lewisdenny
1212
- frenzyfriday

README.md

Lines changed: 209 additions & 168 deletions
Large diffs are not rendered by default.

api/go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ go 1.21
55
require (
66
github.com/onsi/ginkgo/v2 v2.20.1
77
github.com/onsi/gomega v1.34.1
8-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.0
9-
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97
8+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250319162810-463dd75a4cc4
9+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250315090821-34e570d2d5fb
1010
github.com/rhobs/observability-operator v0.3.1
11-
k8s.io/api v0.29.14
12-
k8s.io/apimachinery v0.29.14
13-
k8s.io/client-go v0.29.14
11+
k8s.io/api v0.29.15
12+
k8s.io/apimachinery v0.29.15
13+
k8s.io/client-go v0.29.15
1414
sigs.k8s.io/controller-runtime v0.17.6
1515
)
1616

@@ -66,8 +66,8 @@ require (
6666
gopkg.in/inf.v0 v0.9.1 // indirect
6767
gopkg.in/yaml.v2 v2.4.0 // indirect
6868
gopkg.in/yaml.v3 v3.0.1 // indirect
69-
k8s.io/apiextensions-apiserver v0.29.14 // indirect
70-
k8s.io/component-base v0.29.14 // indirect
69+
k8s.io/apiextensions-apiserver v0.29.15 // indirect
70+
k8s.io/component-base v0.29.15 // indirect
7171
k8s.io/klog/v2 v2.120.1 // indirect
7272
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
7373
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect

api/go.sum

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo
7272
github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
7373
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
7474
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
75-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.0 h1:28i9Yc3UAdQK8VNzk0ubwq4n+qLuhD0nk6/7iHgD9us=
76-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.0/go.mod h1:JgcmYJyyMKfArK8ulZnbls0L01qt8Dq6s5LH8TZH63A=
77-
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97 h1:3LC66vrXJzGMV/eCdvImosOEL2Cgc2KFJIm2YhfTG3w=
78-
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97/go.mod h1:rgpcv2tLD+/vudXx/gpIQSTuRpk4GOxHx84xwfvQalM=
75+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250319162810-463dd75a4cc4 h1:wb2zsr9x9LantNLN/9dmYM42c3yLq3QuzsoOlGpDUxM=
76+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250319162810-463dd75a4cc4/go.mod h1:n5DV/lGE9DHryAJ+JLJSgUXI2QHTj+aN4KoeSNC3PfU=
77+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250315090821-34e570d2d5fb h1:UAFYEHnbyhO0+yymquFmIqxc9QGji9mzreuYrDS1Ev4=
78+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250315090821-34e570d2d5fb/go.mod h1:1CtBP0MQffdjE6buOv5jP2rB3+h7WH0a11lcyrpmxOk=
7979
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8080
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8181
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -183,16 +183,16 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
183183
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
184184
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
185185
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
186-
k8s.io/api v0.29.14 h1:JWFh5ufowH3Y6tCgEzY3URVJHb27f0tEDEej0nCjWDw=
187-
k8s.io/api v0.29.14/go.mod h1:IV8YqKxMm8JGLBLlHM13Npn5lCITH10XYipWEW+YEOQ=
188-
k8s.io/apiextensions-apiserver v0.29.14 h1:gw9WXrZJPu5kpI1UC+Wf8BVe9PWwRUB/UZXU8VzBsq4=
189-
k8s.io/apiextensions-apiserver v0.29.14/go.mod h1:TJ51W+HKW2XqTtAsEFOz1/OohsMtekbKaTXh8ldioL4=
190-
k8s.io/apimachinery v0.29.14 h1:IDhwnGNCp836SLOwW1SoEfFNV77wxIklhxeAHX9vmSo=
191-
k8s.io/apimachinery v0.29.14/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y=
192-
k8s.io/client-go v0.29.14 h1:OSnzZ9DClaFRgl3zMAY2kGZhNjdGJkEb+RDz+MW2h6k=
193-
k8s.io/client-go v0.29.14/go.mod h1:XtZt5n5UxKfPJ+sCoTPcEavWgZbLFFxMnAFFRQGK1RY=
194-
k8s.io/component-base v0.29.14 h1:SF1DWN7bc2VloJ/ysegGoi/aHnopEo81aw9CslhqXIw=
195-
k8s.io/component-base v0.29.14/go.mod h1:FoK1PHhFTaEQVvQLw29/Uyfd8Ug0qUKHrUcXIXJ1VxI=
186+
k8s.io/api v0.29.15 h1:QxPcAheYujeBwkdiE0vMyKkAtqUq5YNyXVqimT+me44=
187+
k8s.io/api v0.29.15/go.mod h1:16duIp2ez6GiLPq1g8XtZNIkw6hJpIitpxZSvv0dZ6E=
188+
k8s.io/apiextensions-apiserver v0.29.15 h1:XI5axgsWqMlIIgpHbcz5vPjk06i3ibHv5FUdSfdtQLU=
189+
k8s.io/apiextensions-apiserver v0.29.15/go.mod h1:6ZU61z32I8WUwbBTPIANUesTj5G40sZek0ojmeoMJI8=
190+
k8s.io/apimachinery v0.29.15 h1:aLc0wghElkdnTO7TMVTxTrifoXah1lqRL8s6szDHGbg=
191+
k8s.io/apimachinery v0.29.15/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y=
192+
k8s.io/client-go v0.29.15 h1:zCBOXKCtz9Hl8boKUGs8zbtZEP6pc7O8Ov3ma+gnS6o=
193+
k8s.io/client-go v0.29.15/go.mod h1:xPy0D3p4sonPhZhI3QoYo4m7oLKoPjFf4vYF9oxoxNM=
194+
k8s.io/component-base v0.29.15 h1:CvmXXTDyk43FDaiJ/Rp+yWFjw6hkUI2t7mIJUrK5j00=
195+
k8s.io/component-base v0.29.15/go.mod h1:jH/sbuvmXew2Fz2iIKNMeNw8o/d1KR9tAg6uekQKnVk=
196196
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
197197
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
198198
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 h1:qVoMaQV5t62UUvHe16Q3eb2c5HPzLHYzsi0Tu/xLndo=

api/v1beta1/autoscaling_types.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import (
2222
corev1 "k8s.io/api/core/v1"
2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
25-
2625
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
2726
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
27+
"k8s.io/apimachinery/pkg/util/validation/field"
2828
)
2929

3030
const (
@@ -302,3 +302,15 @@ func (instance *Autoscaling) GetLastAppliedTopology() *topologyv1.TopoRef {
302302
func (instance *Autoscaling) SetLastAppliedTopology(topologyRef *topologyv1.TopoRef) {
303303
instance.Status.LastAppliedTopology = topologyRef
304304
}
305+
306+
// ValidateTopology -
307+
func (instance *AodhCore) ValidateTopology(
308+
basePath *field.Path,
309+
namespace string,
310+
) field.ErrorList {
311+
var allErrs field.ErrorList
312+
allErrs = append(allErrs, topologyv1.ValidateTopologyRef(
313+
instance.TopologyRef,
314+
*basePath.Child("topologyRef"), namespace)...)
315+
return allErrs
316+
}

api/v1beta1/ceilometer_types.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2121
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23-
23+
"k8s.io/apimachinery/pkg/util/validation/field"
2424
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
2525
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
2626
)
@@ -42,8 +42,7 @@ const (
4242
// KubeStateMetricsImage - default fall-back image for KSM
4343
KubeStateMetricsImage = "registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0"
4444
// MysqldExporterImage - default fall-back image for mysqld_exporter
45-
// MysqldExporterContainerImage = "quay.io/prometheus/mysqld-exporter:v0.16.0"
46-
MysqldExporterContainerImage = ""
45+
MysqldExporterContainerImage = "quay.io/prometheus/mysqld-exporter:v0.16.0"
4746
)
4847

4948
// CeilometerSpec defines the desired state of Ceilometer
@@ -300,3 +299,15 @@ func (instance *Ceilometer) GetLastAppliedTopology() *topologyv1.TopoRef {
300299
func (instance *Ceilometer) SetLastAppliedTopology(topologyRef *topologyv1.TopoRef) {
301300
instance.Status.LastAppliedTopology = topologyRef
302301
}
302+
303+
// ValidateTopology -
304+
func (instance *CeilometerSpecCore) ValidateTopology(
305+
basePath *field.Path,
306+
namespace string,
307+
) field.ErrorList {
308+
var allErrs field.ErrorList
309+
allErrs = append(allErrs, topologyv1.ValidateTopologyRef(
310+
instance.TopologyRef,
311+
*basePath.Child("topologyRef"), namespace)...)
312+
return allErrs
313+
}

api/v1beta1/telemetry_webhook.go

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,20 @@ func (spec *TelemetrySpecCore) ValidateTelemetryTopology(basePath *field.Path, n
202202

203203
// When a TopologyRef CR is referenced, fail if a different Namespace is
204204
// referenced because is not supported
205-
if spec.TopologyRef != nil {
206-
if err := topologyv1.ValidateTopologyNamespace(spec.TopologyRef.Namespace, *basePath, namespace); err != nil {
207-
allErrs = append(allErrs, err)
208-
}
209-
}
205+
allErrs = append(allErrs, topologyv1.ValidateTopologyRef(
206+
spec.TopologyRef, *basePath.Child("topologyRef"), namespace)...)
210207

211208
// When a TopologyRef CR is referenced with an override to Aodh, fail
212209
// if a different Namespace is referenced because not supported
213-
if spec.Autoscaling.Aodh.TopologyRef != nil {
214-
if err := topologyv1.ValidateTopologyNamespace(spec.Autoscaling.Aodh.TopologyRef.Namespace, *basePath, namespace); err != nil {
215-
allErrs = append(allErrs, err)
216-
}
217-
}
210+
aodhPath := basePath.Child("autoscaling").Child("aodh")
211+
allErrs = append(allErrs,
212+
spec.Autoscaling.Aodh.ValidateTopology(aodhPath, namespace)...)
218213

219214
// When a TopologyRef CR is referenced with an override to Ceilometer,
220215
// fail if a different Namespace is referenced because not supported
221-
if spec.Ceilometer.TopologyRef != nil {
222-
if err := topologyv1.ValidateTopologyNamespace(spec.Ceilometer.TopologyRef.Namespace, *basePath, namespace); err != nil {
223-
allErrs = append(allErrs, err)
224-
}
225-
}
216+
ceilPath := basePath.Child("ceilometer")
217+
allErrs = append(allErrs,
218+
spec.Ceilometer.ValidateTopology(ceilPath, namespace)...)
226219

227220
return allErrs
228221
}
@@ -233,27 +226,20 @@ func (spec *TelemetrySpec) ValidateTelemetryTopology(basePath *field.Path, names
233226

234227
// When a TopologyRef CR is referenced, fail if a different Namespace is
235228
// referenced because is not supported
236-
if spec.TopologyRef != nil {
237-
if err := topologyv1.ValidateTopologyNamespace(spec.TopologyRef.Namespace, *basePath, namespace); err != nil {
238-
allErrs = append(allErrs, err)
239-
}
240-
}
229+
allErrs = append(allErrs, topologyv1.ValidateTopologyRef(
230+
spec.TopologyRef, *basePath.Child("topologyRef"), namespace)...)
241231

242232
// When a TopologyRef CR is referenced with an override to Aodh, fail
243233
// if a different Namespace is referenced because not supported
244-
if spec.Autoscaling.Aodh.TopologyRef != nil {
245-
if err := topologyv1.ValidateTopologyNamespace(spec.Autoscaling.Aodh.TopologyRef.Namespace, *basePath, namespace); err != nil {
246-
allErrs = append(allErrs, err)
247-
}
248-
}
234+
aodhPath := basePath.Child("autoscaling").Child("aodh")
235+
allErrs = append(allErrs,
236+
spec.Autoscaling.Aodh.ValidateTopology(aodhPath, namespace)...)
249237

250238
// When a TopologyRef CR is referenced with an override to Ceilometer,
251239
// fail if a different Namespace is referenced because not supported
252-
if spec.Ceilometer.TopologyRef != nil {
253-
if err := topologyv1.ValidateTopologyNamespace(spec.Ceilometer.TopologyRef.Namespace, *basePath, namespace); err != nil {
254-
allErrs = append(allErrs, err)
255-
}
256-
}
240+
ceilPath := basePath.Child("ceilometer")
241+
allErrs = append(allErrs,
242+
spec.Ceilometer.ValidateTopology(ceilPath, namespace)...)
257243

258244
return allErrs
259245
}

0 commit comments

Comments
 (0)