Skip to content

Commit ed6275a

Browse files
committed
Access telemetry Enabled values as pointers
1 parent 114839d commit ed6275a

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
@@ -24,7 +24,7 @@ require (
2424
github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240610180318-22bca1cb3fd4
2525
github.com/openstack-k8s-operators/placement-operator/api v0.3.1-0.20240606155430-0863f223076f
2626
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1
27-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca
27+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c
2828
github.com/rabbitmq/cluster-operator/v2 v2.6.0
2929
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.69.0-rhobs1 // indirect
3030
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
@@ -115,8 +115,8 @@ github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.2024031
115115
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240313124519-961a0ee8bf7f/go.mod h1:Zryxg5YgbPUFcLSCcKpf10il8kIRAK5HloNo6khhdis=
116116
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1 h1:unkiHNm4ZncqYk/Fr22s7cgHCyio1P+7ZznaFoqUDAY=
117117
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1/go.mod h1:c1zUCO1JcfmHMtbWbq94xWz3yzcYAc49JvgGoy51UpE=
118-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca h1:B4e23o2oK8fMBvXzr/PuIInQ5F1oBnYnj6NjyhkyTxo=
119-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
118+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c h1:IWVWcLkUO+1T6DHJyOnIOD7WmGN9bHz7ZVaFItuyQ6g=
119+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
120120
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
121121
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
122122
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
@@ -36,7 +36,7 @@ require (
3636
github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240610180318-22bca1cb3fd4
3737
github.com/openstack-k8s-operators/placement-operator/api v0.3.1-0.20240606155430-0863f223076f
3838
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1
39-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca
39+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c
4040
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240607060532-91bef1029945
4141
github.com/operator-framework/api v0.20.0
4242
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
@@ -148,8 +148,8 @@ github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.2024031
148148
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240313124519-961a0ee8bf7f/go.mod h1:Zryxg5YgbPUFcLSCcKpf10il8kIRAK5HloNo6khhdis=
149149
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1 h1:unkiHNm4ZncqYk/Fr22s7cgHCyio1P+7ZznaFoqUDAY=
150150
github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240604073634-259c9bde9cd1/go.mod h1:c1zUCO1JcfmHMtbWbq94xWz3yzcYAc49JvgGoy51UpE=
151-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca h1:B4e23o2oK8fMBvXzr/PuIInQ5F1oBnYnj6NjyhkyTxo=
152-
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240605210308-c2077c1640ca/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
151+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c h1:IWVWcLkUO+1T6DHJyOnIOD7WmGN9bHz7ZVaFItuyQ6g=
152+
github.com/openstack-k8s-operators/telemetry-operator/api v0.3.1-0.20240612165248-d0f83a47916c/go.mod h1:EuzACoj5reBC4tvdsMkSsoIMcYmrPTC16gEb0qkR86Y=
153153
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240607060532-91bef1029945 h1:RYDpOusA94CdfzfC6EwYAGHaI9kOZ8e1HR6IobvwUIU=
154154
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240607060532-91bef1029945/go.mod h1:UgqzIVmPod3EOAwoaiB4nXSpyOO5NI2GJKAwjLi+VzU=
155155
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
)
@@ -227,11 +228,8 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
227228
instance.Spec.Telemetry.Template.Logging.DeepCopyInto(&telemetry.Spec.Logging)
228229
instance.Spec.Telemetry.Template.MetricStorage.DeepCopyInto(&telemetry.Spec.MetricStorage)
229230

230-
// FIXME: need to switch telemetry operator enabled defaults to bool pointers to get around webhook defaulting issues
231-
telemetry.Spec.Ceilometer.Enabled = instance.Spec.Telemetry.Template.Ceilometer.Enabled
232-
telemetry.Spec.Autoscaling.Enabled = instance.Spec.Telemetry.Template.Autoscaling.Enabled
233-
telemetry.Spec.Logging.Enabled = instance.Spec.Telemetry.Template.Logging.Enabled
234-
telemetry.Spec.MetricStorage.Enabled = instance.Spec.Telemetry.Template.MetricStorage.Enabled
231+
telemetry.Spec.Ceilometer.Enabled = ptr.To(*instance.Spec.Telemetry.Template.Ceilometer.Enabled)
232+
telemetry.Spec.Autoscaling.Enabled = ptr.To(*instance.Spec.Telemetry.Template.Autoscaling.Enabled)
235233

236234
telemetry.Spec.Ceilometer.CentralImage = *version.Status.ContainerImages.CeilometerCentralImage
237235
telemetry.Spec.Ceilometer.ComputeImage = *version.Status.ContainerImages.CeilometerComputeImage

0 commit comments

Comments
 (0)