From b198bc7e39c4708c8b9c371b8770cfc4cb56beb4 Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Sat, 11 Mar 2023 13:10:14 -0800 Subject: [PATCH] Fix the tests so they can run locked down. (#111) --- .../templates/tests/test-connection.yaml | 14 +++++++++++--- .../templates/tests/test-connection.yaml | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/tests/test-connection.yaml b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/tests/test-connection.yaml index c71ad51..7c2389e 100644 --- a/charts/spire/charts/spiffe-oidc-discovery-provider/templates/tests/test-connection.yaml +++ b/charts/spire/charts/spiffe-oidc-discovery-provider/templates/tests/test-connection.yaml @@ -7,17 +7,25 @@ metadata: annotations: "helm.sh/hook": test spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 4 }} containers: - name: wget-service-name image: busybox command: ['wget'] - args: ['{{ include "spiffe-oidc-discovery-provider.fullname" . }}:{{ .Values.service.port }}/.well-known/openid-configuration'] + args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}:{{ .Values.service.port }}/.well-known/openid-configuration'] + securityContext: + {{- toYaml .Values.securityContext | nindent 8 }} - name: wget-service-name-namespace image: busybox command: ['wget'] - args: ['{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}/.well-known/openid-configuration'] + args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}/.well-known/openid-configuration'] + securityContext: + {{- toYaml .Values.securityContext | nindent 8 }} - name: wget-service-name-namespace-svc-cluster-local image: busybox command: ['wget'] - args: ['{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/.well-known/openid-configuration'] + args: ['-O', '/dev/null', '{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/.well-known/openid-configuration'] + securityContext: + {{- toYaml .Values.securityContext | nindent 8 }} restartPolicy: Never diff --git a/charts/spire/charts/spire-server/templates/tests/test-connection.yaml b/charts/spire/charts/spire-server/templates/tests/test-connection.yaml index 60f83f3..f277706 100644 --- a/charts/spire/charts/spire-server/templates/tests/test-connection.yaml +++ b/charts/spire/charts/spire-server/templates/tests/test-connection.yaml @@ -7,9 +7,13 @@ metadata: annotations: "helm.sh/hook": test spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 4 }} containers: - name: wget image: busybox command: ['nc'] args: ['-zvw3', '{{ include "spire-server.fullname" . }}', '{{ .Values.service.port }}'] + securityContext: + {{- toYaml .Values.securityContext | nindent 8 }} restartPolicy: Never