Skip to content

fix(litmus-helm-agent): align label selectors with litmus-agent Helm chart - #721

Merged
ispeakc0de merged 1 commit into
litmuschaos:masterfrom
pierluigilenoci:fix/helm-agent-label-selectors
Apr 16, 2026
Merged

ispeakc0de merged 1 commit into
litmuschaos:masterfrom
pierluigilenoci:fix/helm-agent-label-selectors

Conversation

@pierluigilenoci

Copy link
Copy Markdown
Contributor

Summary

Fix the hardcoded COMPONENTS/DEPLOYMENTS label selectors in the litmus-helm-agent subscriber-config to match the labels actually applied by the litmus-agent Helm chart.

Problem

In custom/litmus-helm-agent/pkg/litmus/client.go, the prepareInfraConfigMap() function hardcodes label selectors using litmuschaos.io/app= prefix:

selector := `["litmuschaos.io/app=chaos-exporter", "litmuschaos.io/app=chaos-operator", "litmuschaos.io/app=event-tracker", "litmuschaos.io/app=workflow-controller"]`

But the litmus-agent Helm chart (litmus-helm) deploys components with different labels:

Component Helm chart label Was in subscriber-config
chaos-exporter app=chaos-exporter litmuschaos.io/app=chaos-exporter
chaos-operator name=chaos-operator litmuschaos.io/app=chaos-operator
event-tracker app=event-tracker litmuschaos.io/app=event-tracker
workflow-controller app=workflow-controller litmuschaos.io/app=workflow-controller

The subscriber uses these selectors to discover and monitor agent components via LabelSelector in Kubernetes API calls. The mismatch causes the subscriber to report all components as missing/not-ready.

Fix

Update the hardcoded selectors to match the actual Helm chart labels:

selector := `["app=chaos-exporter", "name=chaos-operator", "app=event-tracker", "app=workflow-controller"]`

These labels match both the litmus-agent Helm chart and the ChaosCenter manifests INFRA_DEPLOYMENTS value.

Fixes litmuschaos/litmus#4973

Test plan

  • go build ./... passes
  • Deploy litmus-agent via Helm and verify subscriber correctly discovers all components

…Helm chart

The COMPONENTS/DEPLOYMENTS label selectors in the subscriber-config
ConfigMap were hardcoded with `litmuschaos.io/app=` prefix, but the
litmus-agent Helm chart deploys components with different labels:

- chaos-exporter:      `app=chaos-exporter` (not litmuschaos.io/app)
- chaos-operator:      `name=chaos-operator` (not litmuschaos.io/app)
- event-tracker:       `app=event-tracker` (not litmuschaos.io/app)
- workflow-controller: `app=workflow-controller` (not litmuschaos.io/app)

This mismatch caused the subscriber to fail component discovery when
deployed via the Helm chart, as no pods matched the selectors.

Fixes litmuschaos/litmus#4973

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
@pierluigilenoci

Copy link
Copy Markdown
Contributor Author

@Saranya-jena @namkyu1999 @S-ayanide this is ready for review.

One-line fix to align the subscriber-config label selectors with the actual labels used by the litmus-agent Helm chart. Without this, the subscriber can't discover any of the agent components when deployed via Helm.

@pierluigilenoci

Copy link
Copy Markdown
Contributor Author

@Jonsy13 @uditgaurav @ispeakc0de could you please review this when you get a chance? Thanks!

@PriteshKiri

Copy link
Copy Markdown

Hey @pierluigilenoci
Thank you so much for your contribution! 🙌
Please keep an eye on your PR, as we may add some review comments if needed before merging it.

@pierluigilenoci

Copy link
Copy Markdown
Contributor Author

Hi @Jonsy13, @ispeakc0de — gentle ping. Would you be able to review this when you get a chance? Thank you!

@PriteshKiri

Copy link
Copy Markdown

Hey @pierluigilenoci

@ispeakc0de will review it shortly.

@pierluigilenoci

Copy link
Copy Markdown
Contributor Author

Hi @ispeakc0de, @Jonsy13, @uditgaurav -- friendly follow-up. It's been about two weeks since the last ping with no response. CI is green and the fix is straightforward (aligning label selectors). Could someone please take a look? Happy to address any feedback. Thank you!

@ispeakc0de
ispeakc0de merged commit 1ed6aaf into litmuschaos:master Apr 16, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The litmus-agent helm chart labels differ from the one used by Chaos Center

3 participants