diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index cd31289ce8e667cea296c20a610213e2ac792dca..6e672657864339b915c7dc4306081a297961f9c5 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -28,7 +28,7 @@ {{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}} {{- define "app.defaultLabels" }} -app.kubernetes.io/instance: {{ include "app.name" . }} +app.kubernetes.io/instance: afm-adapter app.kubernetes.io/managed-by: {{ include "app.managedBy" . }} app.kubernetes.io/name: {{ include "app.name" . }} app.kubernetes.io/part-of: kop diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 8bcb19bf9d1780cefd43434744dc8b624384dd9a..4088ce25aa16e6196234404eb9ef102e809de6e7 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -21,7 +21,7 @@ spec: metadata: labels: {{- include "app.defaultLabels" . | indent 8 }} - component: intelliform-adapter + component: afm-adapter spec: topologySpreadConstraints: - maxSkew: 1 diff --git a/unit-tests/deployment_defaults_labels_test.yaml b/unit-tests/deployment_defaults_labels_test.yaml index 59ee67490ee1644d2c82689d9c261d40996597e6..df6eaf35f8158d938f3f7fe92cff45d3ebc58e19 100644 --- a/unit-tests/deployment_defaults_labels_test.yaml +++ b/unit-tests/deployment_defaults_labels_test.yaml @@ -8,10 +8,12 @@ templates: - templates/service.yaml tests: - it: check default labels + set: + scrapeMetricsDisabled: false asserts: - equal: path: metadata.labels.[app.kubernetes.io/instance] - value: intelliform-adapter + value: afm-adapter - equal: path: metadata.labels.[app.kubernetes.io/name] value: intelliform-adapter diff --git a/unit-tests/service_monitor_test.yaml b/unit-tests/service_monitor_test.yaml index beb6ba56fb086d0e1f080a3906a90f1c0f892d99..00a2700460e273b76523f9cbb094bf3d2165d05e 100644 --- a/unit-tests/service_monitor_test.yaml +++ b/unit-tests/service_monitor_test.yaml @@ -6,6 +6,8 @@ templates: - templates/service_monitor.yaml tests: - it: should have the label component with value afm-adapter-service-monitor attached + set: + scrapeMetricsDisabled: false asserts: - isKind: of: ServiceMonitor @@ -14,6 +16,7 @@ tests: value: afm-adapter-service-monitor - it: should have the metrics endpoint configured by default set: + scrapeMetricsDisabled: false env.springProfiles: oc,stage asserts: - isKind: @@ -35,16 +38,22 @@ tests: port: metrics path: /actuator/prometheus - it: namespace selector should contain the namespace + set: + scrapeMetricsDisabled: false asserts: - contains: path: spec.namespaceSelector.matchNames content: sh-helm-test - it: selector should contain the component label with the value afm-adapter-service + set: + scrapeMetricsDisabled: false asserts: - equal: path: spec.selector.matchLabels.[component] value: afm-adapter-service - it: selector should contain helm recommended labels name and namespace + set: + scrapeMetricsDisabled: false asserts: - equal: path: spec.selector.matchLabels.[app.kubernetes.io/name] diff --git a/unit-tests/service_test.yaml b/unit-tests/service_test.yaml index 4a24297a85d1a344424aba8952950640c4f5735c..26c9f0d9760c227fd55904d9cb5b518617721b0e 100644 --- a/unit-tests/service_test.yaml +++ b/unit-tests/service_test.yaml @@ -29,6 +29,8 @@ tests: count: 1 any: true - it: ports should contain the metrics port + set: + scrapeMetricsDisabled: false asserts: - contains: path: spec.ports