Skip to content

Commit

Permalink
Merge pull request #28 from dnvgl/fix-additionalpodannotations
Browse files Browse the repository at this point in the history
Fix bug in additionalPodAnnotations
  • Loading branch information
areicher authored Mar 11, 2024
2 parents 5b7e42f + 5abd454 commit 73f9fde
Show file tree
Hide file tree
Showing 24 changed files with 159 additions and 84 deletions.
2 changes: 1 addition & 1 deletion charts/platform-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.1"
description: Platform service chart
name: platform-service
version: 1.2.5
version: 1.2.6
2 changes: 1 addition & 1 deletion charts/platform-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
{{- end }}
{{- end }}
{{- with .Values.additionalPodAnnotations }}
{{ toYaml . | indent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "platform-service.serviceAccountName" . }}
Expand Down
23 changes: 23 additions & 0 deletions testing/generate-results.sh
Original file line number Diff line number Diff line change
@@ -1,104 +1,127 @@
# Run helm template to allow comparing differences from run to run
# Replaces chart version with `test` to avoid creating diffs on every file for every change

rm results/*.yaml
echo `date` > results/run-date.txt

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/base-case.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set gateway.exposeService=false \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/not-exposed.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set sessionManagement.enabled=false \
--show-only templates/deployment.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/no-sessman.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set sessionManagement.redirectToLogin=true \
--show-only templates/deployment.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/sessman-with-redirect.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set mergeAppMetrics=true \
--show-only templates/deployment.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/mergeAppMetrics.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set deploymentOnly=true \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/deployment-only.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.enabled=false \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-default-routing-disabled.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.retries.enabled=true \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-with-retries.yaml


helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.allHosts=true \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-all-hosts.yaml


helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.urlPrefixes= \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-no-urlPrefixes.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.rewriteUrlPrefix.enabled=false \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-rewriteUrlPrefix-disabled.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.redirectOnNoTrailingSlash=false \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-no-slash-redirect.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
-f cors-policy-values.yaml \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-cors-policy.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.urlExactMatches[0]="url1",defaultRouting.urlExactMatches[0]="url2" \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-exact-matches.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set defaultRouting.urlRegexes[0]="/api/.*" \
--show-only templates/virtualservice.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/vs-regexPrefixes.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set opa.enabled=true \
--show-only templates/deployment.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/opa-enabled.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
-f opa-resource-values.yaml \
--set opa.enabled=true \
--show-only templates/deployment.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/opa-with-resources.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set image.full=alt-registry/alt-repo:alt-tag \
--show-only templates/deployment.yaml \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/full-image-syntax.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set image.fluxAutomation.enabled=true \
--debug \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/default-image-automation.yaml

helm template test-release ../charts/platform-service -n test-ns -f values.yaml \
--set image.fluxAutomation.enabled=true,image.fluxAutomation.filterTags.pattern='^dev-(?P<build>.*)',image.fluxAutomation.filterTags.extract='$build',image.fluxAutomation.policy.semver.range='> 0' \
--show-only templates/image-policy.yaml \
--show-only templates/image-repository.yaml \
--debug \
| sed 's/platform-service-.*/platform-service-test/g' \
> results/image-automation-options.yaml

echo " *** kubeval results ***"
Expand Down
26 changes: 15 additions & 11 deletions testing/results/base-case.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -49,7 +49,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -63,7 +63,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -86,7 +86,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -101,12 +101,16 @@ spec:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
session-management: backend
annotations:
session-management: backend
label1: "1"
label2: "2"
annotations:
anno1: "1"
anno2: "2"
spec:
serviceAccountName: test
securityContext:
Expand Down Expand Up @@ -183,7 +187,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -214,7 +218,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -234,7 +238,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -273,7 +277,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down
26 changes: 15 additions & 11 deletions testing/results/default-image-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -49,7 +49,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -63,7 +63,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -86,7 +86,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -101,12 +101,16 @@ spec:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
session-management: backend
annotations:
session-management: backend
label1: "1"
label2: "2"
annotations:
anno1: "1"
anno2: "2"
spec:
serviceAccountName: test
securityContext:
Expand Down Expand Up @@ -183,7 +187,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -214,7 +218,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -255,7 +259,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -294,7 +298,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down
20 changes: 12 additions & 8 deletions testing/results/deployment-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -49,7 +49,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -64,12 +64,16 @@ spec:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
session-management: backend
annotations:
session-management: backend
label1: "1"
label2: "2"
annotations:
anno1: "1"
anno2: "2"
spec:
serviceAccountName: test
securityContext:
Expand Down Expand Up @@ -149,7 +153,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down Expand Up @@ -180,7 +184,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand All @@ -200,7 +204,7 @@ metadata:
labels:
app: test
app.kubernetes.io/name: test
helm.sh/chart: platform-service-1.2.4
helm.sh/chart: platform-service-test
app.kubernetes.io/instance: test-release
version: v1
state: stateful
Expand Down
Loading

0 comments on commit 73f9fde

Please sign in to comment.