From 547f683c078732ba857f4e0bdb71df9ba941d970 Mon Sep 17 00:00:00 2001 From: Kilian Ries Date: Wed, 1 Jun 2022 10:51:03 +0200 Subject: [PATCH] remove prom scrape annotation --- internal/resource/statefulset.go | 12 ++---------- internal/resource/statefulset_test.go | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/internal/resource/statefulset.go b/internal/resource/statefulset.go index 8e8a20ee9..0a000f6c5 100644 --- a/internal/resource/statefulset.go +++ b/internal/resource/statefulset.go @@ -326,16 +326,8 @@ func sortVolumeMounts(mounts []corev1.VolumeMount) { } func (builder *StatefulSetBuilder) podTemplateSpec(previousPodAnnotations map[string]string) corev1.PodTemplateSpec { - // default pod annotations used for prometheus metrics - prometheusPort := "15692" - if builder.Instance.TLSEnabled() { - prometheusPort = "15691" - } - - defaultPodAnnotations := map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": prometheusPort, - } + // default pod annotations + defaultPodAnnotations := make(map[string]string, 0) if builder.Instance.VaultEnabled() { defaultPodAnnotations = appendVaultAnnotations(defaultPodAnnotations, builder.Instance) diff --git a/internal/resource/statefulset_test.go b/internal/resource/statefulset_test.go index 02953f5fd..fba6942a8 100644 --- a/internal/resource/statefulset_test.go +++ b/internal/resource/statefulset_test.go @@ -405,9 +405,6 @@ var _ = Describe("StatefulSet", func() { It("Adds the default annotations to the pod template", func() { Expect(stsBuilder.Update(statefulSet)).To(Succeed()) - - Expect(statefulSet.Spec.Template.Annotations).To(HaveKeyWithValue("prometheus.io/scrape", "true")) - Expect(statefulSet.Spec.Template.Annotations).To(HaveKeyWithValue("prometheus.io/port", "15692")) }) }) @@ -415,10 +412,7 @@ var _ = Describe("StatefulSet", func() { It("updates Prometheus port", func() { stsBuilder.Instance.Spec.TLS.SecretName = "tls-secret" Expect(stsBuilder.Update(statefulSet)).To(Succeed()) - expectedPodAnnotations := map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": "15691", - } + expectedPodAnnotations := make(map[string]string, 0) Expect(statefulSet.Spec.Template.Annotations).To(Equal(expectedPodAnnotations)) }) }) @@ -1850,9 +1844,7 @@ default_pass = {{ .Data.data.password }} "app.kubernetes.io/name": "foo", })) Expect(statefulSet.Spec.Template.ObjectMeta.Annotations).To(Equal(map[string]string{ - "my-key": "my-value", - "prometheus.io/scrape": "true", - "prometheus.io/port": "15692", + "my-key": "my-value", })) })