Skip to content

Commit

Permalink
fix: exporter ports enabled even when exporters disabled (OT-CONTAINE…
Browse files Browse the repository at this point in the history
…R-KIT#484)

* fix: exporter ports enabled even when exporters disabled

Signed-off-by: sadath-12 <[email protected]>

* fix: dependency issues

Signed-off-by: sadath-12 <[email protected]>

---------

Signed-off-by: sadath-12 <[email protected]>
Signed-off-by: guozhi.li <[email protected]>
  • Loading branch information
sadath-12 authored and guozhi.li committed Jul 20, 2023
1 parent f43e584 commit abce2b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions k8sutils/redis-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ func (service RedisClusterService) CreateRedisClusterService(cr *redisv1beta1.Re
annotations := generateServiceAnots(cr.ObjectMeta, nil)
if cr.Spec.RedisExporter != nil && cr.Spec.RedisExporter.Enabled {
enableMetrics = true
} else {
enableMetrics = false
}
additionalServiceAnnotations := map[string]string{}
if cr.Spec.KubernetesConfig.Service != nil {
Expand Down
2 changes: 2 additions & 0 deletions k8sutils/redis-replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ func CreateReplicationService(cr *redisv1beta1.RedisReplication) error {
annotations := generateServiceAnots(cr.ObjectMeta, nil)
if cr.Spec.RedisExporter != nil && cr.Spec.RedisExporter.Enabled {
enableMetrics = true
} else {
enableMetrics = false
}
additionalServiceAnnotations := map[string]string{}
if cr.Spec.KubernetesConfig.Service != nil {
Expand Down
2 changes: 2 additions & 0 deletions k8sutils/redis-sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ func (service RedisSentinelService) CreateRedisSentinelService(cr *redisv1beta1.

if cr.Spec.RedisExporter != nil && cr.Spec.RedisExporter.Enabled {
enableMetrics = true
} else {
enableMetrics = false
}
additionalServiceAnnotations := map[string]string{}
if cr.Spec.KubernetesConfig.Service != nil {
Expand Down
2 changes: 2 additions & 0 deletions k8sutils/redis-standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func CreateStandaloneService(cr *redisv1beta1.Redis) error {
annotations := generateServiceAnots(cr.ObjectMeta, nil)
if cr.Spec.RedisExporter != nil && cr.Spec.RedisExporter.Enabled {
enableMetrics = true
} else {
enableMetrics = false
}
additionalServiceAnnotations := map[string]string{}
if cr.Spec.KubernetesConfig.Service != nil {
Expand Down

0 comments on commit abce2b1

Please sign in to comment.