ci: verify ServiceMonitor metrics relationships

Author: lokesh0186Created Sep 18, 2026Updated Sep 22, 2026
Labelskind/featurearea/charts

Is your feature request related to a problem? Please describe. The chart can render three ServiceMonitor-backed metrics paths for the main controller, webhook, and cert controller. Each path depends on the ServiceMonitor selector, metrics Service, Service selector, Deployment, named targetPort, and 8080/TCP container port staying in sync.

These relationships work on the current main branch. I tested them with the public Beta package iac-guard-v==0.1.0b1, and all three resolved successfully. A selector mismatch was reported as VIOLATED, missing or unresolved ports were reported as NOT_EVALUATED, and a coordinated label change remained SATISFIED. This is not a report of a current production defect.

Metrics Service and port wiring has needed correction before in #485 and #697. A relationship check could catch a future one-sided selector or port change while continuing to allow coordinated chart changes.

Describe the solution you'd like Would the maintainers be open to a focused PR that adds this check to the existing chart-validation CI? It would use iac-guard-v==0.1.0b1 only in CI and would not change chart defaults or rendered production resources. The package is currently Beta.

Describe alternatives you've considered The existing chart tests cover the individual ServiceMonitor, Service, and workload resources. Extending those tests is another option, but it would need to reproduce the cross-resource selector and named-port resolution that this check evaluates directly.

Additional context AI assistance: I used OpenAI Codex to help inspect the chart, run the test cases, and edit this issue. I reviewed the chart files, checked the results, and edited the final text before submission.

Source: external-secrets/external-secrets