fix: Opentelemetry Collector in sidecar mode doesn't count instances (#25407)

Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
This commit is contained in:
Jorge Turrado Ferrero
2025-12-05 02:15:34 +01:00
committed by GitHub
parent cfb6f5e7d7
commit b7c7d02b0e
3 changed files with 32 additions and 14 deletions

View File

@@ -28,8 +28,13 @@ if obj.status ~= nil then
hs.message = "Unable to parse replica status: " ..tostring(statusReplicas)
end
else
hs.status = "Progressing"
hs.message = "Scale status not available"
if obj.spec.mode == "sidecar" then
hs.status = "Healthy"
hs.message = "Collector is running in sidecar mode"
else
hs.status = "Progressing"
hs.message = "Scale status not available"
end
end
end
return hs

View File

@@ -1,13 +1,17 @@
tests:
- healthStatus:
status: Healthy
message: "All replicas are ready"
inputPath: testdata/healthy.yaml
- healthStatus:
status: Degraded
message: "No replicas are ready"
inputPath: testdata/degraded.yaml
- healthStatus:
status: Progressing
message: "Replicas are starting up"
inputPath: testdata/progressing.yaml
- healthStatus:
status: Healthy
message: "All replicas are ready"
inputPath: testdata/healthy.yaml
- healthStatus:
status: Degraded
message: "No replicas are ready"
inputPath: testdata/degraded.yaml
- healthStatus:
status: Progressing
message: "Replicas are starting up"
inputPath: testdata/progressing.yaml
- healthStatus:
status: Healthy
message: "Collector is running in sidecar mode"
inputPath: testdata/sidecar.yaml

View File

@@ -0,0 +1,9 @@
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: test-collector-sidecar
namespace: default
spec:
mode: sidecar
status:
version: 0.124.1