Skip to content
Snippets Groups Projects
Commit 9d9127ce authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1928: intelliform adapter component fix, fix instance value in helpers...

OZG-1928: intelliform adapter component fix, fix instance value in helpers tpl, fix tests by adding the scrapedisabled value
parent 126d1c1f
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
{{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}} {{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}}
{{- define "app.defaultLabels" }} {{- 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/managed-by: {{ include "app.managedBy" . }}
app.kubernetes.io/name: {{ include "app.name" . }} app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/part-of: kop app.kubernetes.io/part-of: kop
......
...@@ -21,7 +21,7 @@ spec: ...@@ -21,7 +21,7 @@ spec:
metadata: metadata:
labels: labels:
{{- include "app.defaultLabels" . | indent 8 }} {{- include "app.defaultLabels" . | indent 8 }}
component: intelliform-adapter component: afm-adapter
spec: spec:
topologySpreadConstraints: topologySpreadConstraints:
- maxSkew: 1 - maxSkew: 1
......
...@@ -8,10 +8,12 @@ templates: ...@@ -8,10 +8,12 @@ templates:
- templates/service.yaml - templates/service.yaml
tests: tests:
- it: check default labels - it: check default labels
set:
scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
path: metadata.labels.[app.kubernetes.io/instance] path: metadata.labels.[app.kubernetes.io/instance]
value: intelliform-adapter value: afm-adapter
- equal: - equal:
path: metadata.labels.[app.kubernetes.io/name] path: metadata.labels.[app.kubernetes.io/name]
value: intelliform-adapter value: intelliform-adapter
......
...@@ -6,6 +6,8 @@ templates: ...@@ -6,6 +6,8 @@ templates:
- templates/service_monitor.yaml - templates/service_monitor.yaml
tests: tests:
- it: should have the label component with value afm-adapter-service-monitor attached - it: should have the label component with value afm-adapter-service-monitor attached
set:
scrapeMetricsDisabled: false
asserts: asserts:
- isKind: - isKind:
of: ServiceMonitor of: ServiceMonitor
...@@ -14,6 +16,7 @@ tests: ...@@ -14,6 +16,7 @@ tests:
value: afm-adapter-service-monitor value: afm-adapter-service-monitor
- it: should have the metrics endpoint configured by default - it: should have the metrics endpoint configured by default
set: set:
scrapeMetricsDisabled: false
env.springProfiles: oc,stage env.springProfiles: oc,stage
asserts: asserts:
- isKind: - isKind:
...@@ -35,16 +38,22 @@ tests: ...@@ -35,16 +38,22 @@ tests:
port: metrics port: metrics
path: /actuator/prometheus path: /actuator/prometheus
- it: namespace selector should contain the namespace - it: namespace selector should contain the namespace
set:
scrapeMetricsDisabled: false
asserts: asserts:
- contains: - contains:
path: spec.namespaceSelector.matchNames path: spec.namespaceSelector.matchNames
content: sh-helm-test content: sh-helm-test
- it: selector should contain the component label with the value afm-adapter-service - it: selector should contain the component label with the value afm-adapter-service
set:
scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
path: spec.selector.matchLabels.[component] path: spec.selector.matchLabels.[component]
value: afm-adapter-service value: afm-adapter-service
- it: selector should contain helm recommended labels name and namespace - it: selector should contain helm recommended labels name and namespace
set:
scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
path: spec.selector.matchLabels.[app.kubernetes.io/name] path: spec.selector.matchLabels.[app.kubernetes.io/name]
......
...@@ -29,6 +29,8 @@ tests: ...@@ -29,6 +29,8 @@ tests:
count: 1 count: 1
any: true any: true
- it: ports should contain the metrics port - it: ports should contain the metrics port
set:
scrapeMetricsDisabled: false
asserts: asserts:
- contains: - contains:
path: spec.ports path: spec.ports
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment