argo-helm
argo-helm copied to clipboard
feat(argo-workflows): check prometheus CRD for ServiceMonitor
ServiceMonitor resource should not be rendered unless Prometheus CRDs are available.
This changeset includes an extra option to override the apiVersion
Prometheus provides.
How to test
1 - ServiceMonitor is NOT rendered if Prometheus CRDs are not available
helm template --set controller.metricsConfig.enabled=true,controller.serviceMonitor.enabled=true charts/argo-workflows
2 - ServiceMonitor IS rendered when Prometheus CRDs are available
helm template --api-versions "monitoring.coreos.com/v1" --set controller.metricsConfig.enabled=true,controller.serviceMonitor.enabled=true charts/argo-workflows
3 - ServiceMonitor is NOT rendered if overriding Prometheus apiVersion and it's not available
helm template --api-versions "monitoring.coreos.com/v1" --set controller.metricsConfig.enabled=true,controller.serviceMonitor.enabled=true,controller.serviceMonitor.apiVersion="monitoring.coreos.com/v2" charts/argo-workflows
close #2427
Checklist:
- [x] I have bumped the chart version according to versioning
- [x] I have updated the documentation according to documentation
- [x] I have updated the chart changelog with all the changes that come with this pull request according to changelog.
- [x] Any new values are backwards compatible and/or have sensible default.
- [x] I have signed off all my commits as required by DCO.
- [ ] My build is green (troubleshooting builds).