From 989a17c85b7f984e0812bcae7447c73c4e784c11 Mon Sep 17 00:00:00 2001 From: Felix Reichenbach <felix.reichenbach@mgm-tp.com> Date: Fri, 7 Feb 2025 16:29:16 +0100 Subject: [PATCH] rename afm to eingang --- src/main/helm/templates/_helpers.tpl | 6 +- src/main/helm/templates/deployment.yaml | 2 +- src/main/helm/templates/service.yaml | 4 +- src/main/helm/templates/service_monitor.yaml | 4 +- src/main/helm/values.yaml | 1 - .../helm/deployment_defaults_labels_test.yaml | 2 +- .../deployment_imagepull_secret_test.yaml | 4 +- src/test/helm/deployment_resources_test.yaml | 3 +- .../helm/deployment_service_account_test.yaml | 9 - src/test/helm/ingress_nginx_test.yaml | 6 +- src/test/helm/ingress_test.yaml | 6 +- src/test/helm/network_policy_test.yaml | 161 +++++++++--------- src/test/helm/service_account_test.yaml | 16 -- src/test/helm/service_monitor_test.yaml | 20 +-- src/test/helm/service_test.yaml | 20 +-- 15 files changed, 117 insertions(+), 147 deletions(-) diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index fdb9ddf34..b0f54ef2d 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -51,7 +51,7 @@ {{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}} {{- define "app.defaultLabels" }} -app.kubernetes.io/instance: afm-adapter +app.kubernetes.io/instance: eingang-adapter app.kubernetes.io/managed-by: {{ include "app.managedBy" . }} app.kubernetes.io/name: {{ .Release.Name }} app.kubernetes.io/part-of: ozgcloud @@ -94,15 +94,13 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- else if eq (.Values.image).name "formcycle-adapter" }} {{- printf "%s-formcycle.%s" (include "app.ozgcloudBezeichner" .) .Values.baseUrl }} {{- else }} -{{- printf "%s-afm.%s" (include "app.ozgcloudBezeichner" .) .Values.baseUrl }} +{{- printf "%s-eingang.%s" (include "app.ozgcloudBezeichner" .) .Values.baseUrl }} {{- end }} {{- end -}} {{- define "app.serviceAccountName" -}} {{- if (.Values.serviceAccount).name }} {{- printf "%s" .Values.serviceAccount.name }} -{{- else if eq (.Values.image).name "intelliform-adapter" }} -{{- printf "afm-adapter-service-account" }} {{- else if eq (.Values.image).name "formcycle-adapter" }} {{- printf "formcycle-adapter-service-account" }} {{- else if eq (.Values.image).name "enterprise-adapter" }} diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index ff60598c9..4ea2406bb 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -45,7 +45,7 @@ spec: metadata: labels: {{- include "app.defaultLabels" . | indent 8 }} - component: afm-adapter + component: eingang-adapter spec: {{- if (.Values.serviceAccount).create }} serviceAccountName: {{ include "app.serviceAccountName" . }} diff --git a/src/main/helm/templates/service.yaml b/src/main/helm/templates/service.yaml index 93574b29b..78dc3c5b8 100644 --- a/src/main/helm/templates/service.yaml +++ b/src/main/helm/templates/service.yaml @@ -29,7 +29,7 @@ metadata: namespace: {{ include "app.namespace" . }} labels: {{- include "app.defaultLabels" . | indent 4 }} - component: afm-adapter-service + component: eingang-adapter-service spec: ports: - name: http @@ -42,4 +42,4 @@ spec: type: ClusterIP selector: {{- include "app.matchLabels" . | indent 4 }} - component: afm-adapter \ No newline at end of file + component: eingang-adapter \ No newline at end of file diff --git a/src/main/helm/templates/service_monitor.yaml b/src/main/helm/templates/service_monitor.yaml index 053a25810..70f64b42e 100644 --- a/src/main/helm/templates/service_monitor.yaml +++ b/src/main/helm/templates/service_monitor.yaml @@ -29,7 +29,7 @@ metadata: namespace: {{ include "app.namespace" . }} labels: {{- include "app.defaultLabels" . | indent 4 }} - component: afm-adapter-service-monitor + component: eingang-adapter-service-monitor spec: endpoints: - port: metrics @@ -40,4 +40,4 @@ spec: selector: matchLabels: {{- include "app.matchLabels" . | indent 6 }} - component: afm-adapter-service \ No newline at end of file + component: eingang-adapter-service \ No newline at end of file diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index 541998250..57e9ee218 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -31,7 +31,6 @@ image: ingress: enabled: true - # overrideHost: kiel-afm.dev.by.ozg-cloud.de routing: targetVorgangManagerName: vorgang-manager diff --git a/src/test/helm/deployment_defaults_labels_test.yaml b/src/test/helm/deployment_defaults_labels_test.yaml index 89894411a..bcc3c9bc5 100644 --- a/src/test/helm/deployment_defaults_labels_test.yaml +++ b/src/test/helm/deployment_defaults_labels_test.yaml @@ -38,7 +38,7 @@ tests: - equal: path: metadata.labels value: - app.kubernetes.io/instance: afm-adapter + app.kubernetes.io/instance: eingang-adapter app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: eingang-adapter app.kubernetes.io/namespace: sh-helm-test diff --git a/src/test/helm/deployment_imagepull_secret_test.yaml b/src/test/helm/deployment_imagepull_secret_test.yaml index 44d18840f..183933f71 100644 --- a/src/test/helm/deployment_imagepull_secret_test.yaml +++ b/src/test/helm/deployment_imagepull_secret_test.yaml @@ -24,7 +24,7 @@ suite: test deployment imagepullsecret release: - name: afm-adapter + name: eingang-adapter namespace: sh-helm-test templates: - templates/deployment.yaml @@ -41,4 +41,4 @@ tests: - it: should fail tempalte when not set asserts: - failedTemplate: - errorMessage: imagePullSecret must be set \ No newline at end of file + errorMessage: imagePullSecret must be set diff --git a/src/test/helm/deployment_resources_test.yaml b/src/test/helm/deployment_resources_test.yaml index 6404c0c9b..a938b0eef 100644 --- a/src/test/helm/deployment_resources_test.yaml +++ b/src/test/helm/deployment_resources_test.yaml @@ -24,7 +24,7 @@ suite: test deployment resources release: - name: afm-adapter + name: eingang-adapter templates: - templates/deployment.yaml set: @@ -58,4 +58,3 @@ tests: asserts: - isEmpty: path: spec.template.spec.containers[0].resources - diff --git a/src/test/helm/deployment_service_account_test.yaml b/src/test/helm/deployment_service_account_test.yaml index fbf9bf795..a3c43ba41 100644 --- a/src/test/helm/deployment_service_account_test.yaml +++ b/src/test/helm/deployment_service_account_test.yaml @@ -33,15 +33,6 @@ set: ozgcloud.environment: test imagePullSecret: image-pull-secret tests: - - it: should use afm-adapter service account name - set: - image.name: intelliform-adapter - serviceAccount: - create: true - asserts: - - equal: - path: spec.template.spec.serviceAccountName - value: afm-adapter-service-account - it: should use formcycle-adapter service account name set: image.name: formcycle-adapter diff --git a/src/test/helm/ingress_nginx_test.yaml b/src/test/helm/ingress_nginx_test.yaml index cd36fce3a..b46286a5d 100644 --- a/src/test/helm/ingress_nginx_test.yaml +++ b/src/test/helm/ingress_nginx_test.yaml @@ -31,13 +31,13 @@ set: bezeichner: helm tests: - - it: should create afm ingress tls + - it: should create eingang ingress tls release: - name: afm-adapter + name: eingang-adapter asserts: - equal: path: spec.tls[0].secretName - value: helm-afm-adapter-tls + value: helm-eingang-adapter-tls - it: should not set secretName set: diff --git a/src/test/helm/ingress_test.yaml b/src/test/helm/ingress_test.yaml index a5a2f64fa..24dc0871a 100644 --- a/src/test/helm/ingress_test.yaml +++ b/src/test/helm/ingress_test.yaml @@ -63,14 +63,14 @@ tests: - equal: path: spec.rules[0].http.paths[0].pathType value: ImplementationSpecific - - it: should create afm host + - it: should create eingang host asserts: - equal: path: spec.rules[0].host - value: helm-afm.test.sh.ozg-cloud.de + value: helm-eingang.test.sh.ozg-cloud.de - equal: path: spec.tls[0].hosts[0] - value: helm-afm.test.sh.ozg-cloud.de + value: helm-eingang.test.sh.ozg-cloud.de - it: should create formcycle host set: diff --git a/src/test/helm/network_policy_test.yaml b/src/test/helm/network_policy_test.yaml index 06a416e43..d10537996 100644 --- a/src/test/helm/network_policy_test.yaml +++ b/src/test/helm/network_policy_test.yaml @@ -24,7 +24,7 @@ suite: network policy test release: - name: afm-adapter + name: eingang-adapter namespace: by-helm-test templates: - templates/network_policy.yaml @@ -51,7 +51,7 @@ tests: - equal: path: metadata value: - name: network-policy-afm-adapter + name: network-policy-eingang-adapter namespace: by-helm-test - it: validate spec set: @@ -68,36 +68,36 @@ tests: - Ingress - Egress ingress: - - ports: - - port: 8080 - - from: - - namespaceSelector: - matchLabels: - name: openshift-user-workload-monitoring - ports: - - protocol: TCP - port: 8081 + - ports: + - port: 8080 + - from: + - namespaceSelector: + matchLabels: + name: openshift-user-workload-monitoring + ports: + - protocol: TCP + port: 8081 egress: - - to: - - podSelector: - matchLabels: - component: vorgang-manager - ports: - - port: 9090 - protocol: TCP - - to: - - namespaceSelector: - matchLabels: - kubernetes.io/metadata.name: test-dns-namespace - ports: - - port: 53 - protocol: UDP - - port: 53 - protocol: TCP - - port: 5353 - protocol: UDP - - port: 5353 - protocol: TCP + - to: + - podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: test-dns-namespace + ports: + - port: 53 + protocol: UDP + - port: 53 + protocol: TCP + - port: 5353 + protocol: UDP + - port: 5353 + protocol: TCP - it: should set monitoring namespace set: @@ -149,40 +149,39 @@ tests: - hasDocuments: count: 1 - - it: should add zufi rules when zufi-routing is enabled set: networkPolicy: dnsServerNamespace: test-dns-server-namespace routing: routingStrategy: ZUFI - zufiManager: + zufiManager: namespace: zufi-namespace asserts: - - contains: - path: spec.egress - content: - to: - - namespaceSelector: - matchLabels: - kubernetes.io/metadata.name: zufi-namespace - podSelector: - matchLabels: - component: zufi-server - ports: - - port: 9090 - protocol: TCP - - contains: - path: spec.egress - content: - to: - - namespaceSelector: {} - podSelector: - matchLabels: - component: vorgang-manager - ports: - - port: 9090 - protocol: TCP + - contains: + path: spec.egress + content: + to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: zufi-namespace + podSelector: + matchLabels: + component: zufi-server + ports: + - port: 9090 + protocol: TCP + - contains: + path: spec.egress + content: + to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP - it: should throw error when zufi is enabled but zufi namespace not set set: @@ -191,35 +190,35 @@ tests: routing: routingStrategy: ZUFI asserts: - - failedTemplate: - errorMessage: routing.zufiManager.namespace must be set if routingStrategy=ZUFI + - failedTemplate: + errorMessage: routing.zufiManager.namespace must be set if routingStrategy=ZUFI - it: should not add zufi rule when zufi-routing is disabled set: networkPolicy: dnsServerNamespace: test-dns-server-namespace routing: - zufiManager: + zufiManager: namespace: zufi-namespace asserts: - - notContains: - path: spec.egress - content: - to: - - namespaceSelector: - matchLabels: - kubernetes.io/metadata.name: zufi-namespace - podSelector: - matchLabels: - component: zufi-server - - notContains: - path: spec.egress - content: - to: - - namespaceSelector: {} - podSelector: - matchLabels: - component: vorgang-manager - ports: - - port: 9090 - protocol: TCP \ No newline at end of file + - notContains: + path: spec.egress + content: + to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: zufi-namespace + podSelector: + matchLabels: + component: zufi-server + - notContains: + path: spec.egress + content: + to: + - namespaceSelector: {} + podSelector: + matchLabels: + component: vorgang-manager + ports: + - port: 9090 + protocol: TCP diff --git a/src/test/helm/service_account_test.yaml b/src/test/helm/service_account_test.yaml index b64225463..e25b18bcf 100644 --- a/src/test/helm/service_account_test.yaml +++ b/src/test/helm/service_account_test.yaml @@ -29,22 +29,6 @@ release: templates: - templates/service_account.yaml tests: - - it: should create default afm adapter service account name - set: - image.name: intelliform-adapter - serviceAccount: - create: true - asserts: - - isKind: - of: ServiceAccount - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: afm-adapter-service-account - - equal: - path: metadata.namespace - value: sh-helm-test - it: should create default formcycle adapter service account name set: image.name: formcycle-adapter diff --git a/src/test/helm/service_monitor_test.yaml b/src/test/helm/service_monitor_test.yaml index 8c4a1b5b0..ccc71edd8 100644 --- a/src/test/helm/service_monitor_test.yaml +++ b/src/test/helm/service_monitor_test.yaml @@ -24,12 +24,12 @@ suite: test service monitor release: - name: afm-adapter + name: eingang-adapter namespace: sh-helm-test templates: - templates/service_monitor.yaml tests: - - it: should have basic info and the label component with value afm-adapter-service-monitor attached + - it: should have basic info and the label component with value eingang-adapter-service-monitor attached asserts: - isKind: of: ServiceMonitor @@ -37,26 +37,26 @@ tests: of: monitoring.coreos.com/v1 - equal: path: metadata.name - value: afm-adapter + value: eingang-adapter - equal: path: metadata.namespace value: sh-helm-test - equal: path: metadata.labels["component"] - value: afm-adapter-service-monitor + value: eingang-adapter-service-monitor - it: should contain default lables and component lables asserts: - equal: path: metadata.labels value: - app.kubernetes.io/instance: afm-adapter + app.kubernetes.io/instance: eingang-adapter app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: afm-adapter + app.kubernetes.io/name: eingang-adapter app.kubernetes.io/namespace: sh-helm-test app.kubernetes.io/part-of: ozgcloud app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS - component: afm-adapter-service-monitor + component: eingang-adapter-service-monitor helm.sh/chart: eingang-adapter-0.0.0-MANAGED-BY-JENKINS ozg-component: eingangsadapter @@ -81,16 +81,16 @@ tests: - contains: path: spec.namespaceSelector.matchNames 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 eingang-adapter-service asserts: - equal: path: spec.selector.matchLabels["component"] - value: afm-adapter-service + value: eingang-adapter-service - it: selector should contain helm recommended labels name and namespace asserts: - equal: path: spec.selector.matchLabels["app.kubernetes.io/name"] - value: afm-adapter + value: eingang-adapter - equal: path: spec.selector.matchLabels["app.kubernetes.io/namespace"] value: sh-helm-test diff --git a/src/test/helm/service_test.yaml b/src/test/helm/service_test.yaml index bec1a28db..16119984f 100644 --- a/src/test/helm/service_test.yaml +++ b/src/test/helm/service_test.yaml @@ -24,12 +24,12 @@ suite: test service release: - name: afm-adapter + name: eingang-adapter namespace: sh-helm-test templates: - templates/service.yaml tests: - - it: should have basics and the label component with value afm-adapter-service attached + - it: should have basics and the label component with value eingang-adapter-service attached asserts: - isKind: of: Service @@ -37,10 +37,10 @@ tests: of: v1 - equal: path: metadata.labels["component"] - value: afm-adapter-service + value: eingang-adapter-service - equal: path: metadata.name - value: afm-adapter + value: eingang-adapter - equal: path: metadata.namespace value: sh-helm-test @@ -70,16 +70,16 @@ tests: protocol: TCP count: 1 any: true - - it: selector should contain the component label with the value afm-adapter + - it: selector should contain the component label with the value eingang-adapter asserts: - equal: path: spec.selector["component"] - value: afm-adapter + value: eingang-adapter - it: selector should contain helm recommended labels name and namespace asserts: - equal: path: spec.selector["app.kubernetes.io/name"] - value: afm-adapter + value: eingang-adapter - equal: path: spec.selector["app.kubernetes.io/namespace"] value: sh-helm-test @@ -89,12 +89,12 @@ tests: - equal: path: metadata.labels value: - app.kubernetes.io/instance: afm-adapter + app.kubernetes.io/instance: eingang-adapter app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: afm-adapter + app.kubernetes.io/name: eingang-adapter app.kubernetes.io/namespace: sh-helm-test app.kubernetes.io/part-of: ozgcloud app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS - component: afm-adapter-service + component: eingang-adapter-service helm.sh/chart: eingang-adapter-0.0.0-MANAGED-BY-JENKINS ozg-component: eingangsadapter -- GitLab