GoogleCloudPlatform / prometheus-engine

Google Cloud Managed Service for Prometheus libraries and manifests.
https://g.co/cloud/managedprometheus
Apache License 2.0
191 stars 89 forks source link

fix(operator): support secrets outside default ns for scrape auth #995

Closed fdaguin closed 3 months ago

fdaguin commented 3 months ago

Fixes the issue shared through https://github.com/GoogleCloudPlatform/prometheus-engine/pull/776#issuecomment-2087606662.

The current implementation only supports a PodMonitoring selecting a Secret from the default namespace.

The existing E2E test cases were using a Secret deployed inside the default namespace therefore not covering this "edge" case:

https://github.com/GoogleCloudPlatform/prometheus-engine/blob/f21c2ba4c0a9c3108209c1e59ec75d52e388235e/e2e/authorization_test.go#L96-L177

fdaguin commented 3 months ago

Thank you for your detailed feedback @TheSpiritXIII 🙏