Skip to content

Commit f5bba4f

Browse files
Merge pull request #848 from vyzigold/telemetry_enabled_pointers
Access telemetry Enabled values as pointers
2 parents e917b86 + ed6275a commit f5bba4f

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

apis/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240610180318-22bca1cb3fd4
2828
github.com/openstack-k8s-operators/placement-operator/api v0.3.1-0.20240606155430-0863f223076f
2929
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1
30-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca
30+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c
3131
github.com/rabbitmq/cluster-operator/v2 v2.6.0
3232
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.69.0-rhobs1 // indirect
3333
github.com/rhobs/observability-operator v0.0.28 // indirect

apis/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.2024031
134134
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240313124519-961a0ee8bf7f/go.mod h1:Zryxg5YgbPUFcLSCcKpf10il8kIRAK5HloNo6khhdis=
135135
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1 h1:unkiHNm4ZncqYk/Fr22s7cgHCyio1P+7ZznaFoqUDAY=
136136
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1/go.mod h1:c1zUCO1JcfmHMtbWbq94xWz3yzcYAc49JvgGoy51UpE=
137-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca h1:B4e23o2oK8fMBvXzr/PuIInQ5F1oBnYnj6NjyhkyTxo=
138-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
137+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c h1:IWVWcLkUO+1T6DHJyOnIOD7WmGN9bHz7ZVaFItuyQ6g=
138+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
139139
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
140140
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
141141
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ require (
3939
github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240610180318-22bca1cb3fd4
4040
github.com/openstack-k8s-operators/placement-operator/api v0.3.1-0.20240606155430-0863f223076f
4141
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1
42-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca
42+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c
4343
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240607060532-91bef1029945
4444
github.com/operator-framework/api v0.20.0
4545
github.com/rabbitmq/cluster-operator/v2 v2.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.2024031
150150
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240313124519-961a0ee8bf7f/go.mod h1:Zryxg5YgbPUFcLSCcKpf10il8kIRAK5HloNo6khhdis=
151151
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1 h1:unkiHNm4ZncqYk/Fr22s7cgHCyio1P+7ZznaFoqUDAY=
152152
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1/go.mod h1:c1zUCO1JcfmHMtbWbq94xWz3yzcYAc49JvgGoy51UpE=
153-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca h1:B4e23o2oK8fMBvXzr/PuIInQ5F1oBnYnj6NjyhkyTxo=
154-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
153+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c h1:IWVWcLkUO+1T6DHJyOnIOD7WmGN9bHz7ZVaFItuyQ6g=
154+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
155155
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240607060532-91bef1029945 h1:RYDpOusA94CdfzfC6EwYAGHaI9kOZ8e1HR6IobvwUIU=
156156
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240607060532-91bef1029945/go.mod h1:UgqzIVmPod3EOAwoaiB4nXSpyOO5NI2GJKAwjLi+VzU=
157157
github.com/operator-framework/api v0.20.0 h1:A2YCRhr+6s0k3pRJacnwjh1Ue8BqjIGuQ2jvPg9XCB4=

pkg/openstack/telemetry.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
k8s_errors "k8s.io/apimachinery/pkg/api/errors"
1717
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1818
"k8s.io/apimachinery/pkg/types"
19+
"k8s.io/utils/ptr"
1920
ctrl "sigs.k8s.io/controller-runtime"
2021
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2122
)
@@ -241,11 +242,8 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
241242
instance.Spec.Telemetry.Template.Logging.DeepCopyInto(&telemetry.Spec.Logging)
242243
instance.Spec.Telemetry.Template.MetricStorage.DeepCopyInto(&telemetry.Spec.MetricStorage)
243244

244-
// FIXME: need to switch telemetry operator enabled defaults to bool pointers to get around webhook defaulting issues
245-
telemetry.Spec.Ceilometer.Enabled = instance.Spec.Telemetry.Template.Ceilometer.Enabled
246-
telemetry.Spec.Autoscaling.Enabled = instance.Spec.Telemetry.Template.Autoscaling.Enabled
247-
telemetry.Spec.Logging.Enabled = instance.Spec.Telemetry.Template.Logging.Enabled
248-
telemetry.Spec.MetricStorage.Enabled = instance.Spec.Telemetry.Template.MetricStorage.Enabled
245+
telemetry.Spec.Ceilometer.Enabled = ptr.To(*instance.Spec.Telemetry.Template.Ceilometer.Enabled)
246+
telemetry.Spec.Autoscaling.Enabled = ptr.To(*instance.Spec.Telemetry.Template.Autoscaling.Enabled)
249247

250248
telemetry.Spec.Ceilometer.CentralImage = *version.Status.ContainerImages.CeilometerCentralImage
251249
telemetry.Spec.Ceilometer.ComputeImage = *version.Status.ContainerImages.CeilometerComputeImage

0 commit comments

Comments
 (0)