Allow overriding test images (#186)

This commit is contained in:
kfox1111
2023-06-14 21:17:08 +02:00
committed by GitHub
parent 250fd5db00
commit 4c0a1d52c5
8 changed files with 55 additions and 10 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
set -o pipefail set -o pipefail
# Look for image: definitions that are not templated. If we find none, exit is not 0 and we invert the error code to get the # Look for image: definitions that are not templated. If we find none, exit is not 0 and we invert the error code to get the
# test to pass. Ignore tests for now... # test to pass. Ignore tests for now...
grep "image:" charts/spire/charts/*/templates/*.* | grep -v 'image: {{ template "' > /tmp/findings grep -r "image:" charts/spire | grep "templates/" | grep -v 'image: {{ template "' > /tmp/findings
res=$? res=$?
if [ $res -eq 0 ]; then if [ $res -eq 0 ]; then
{ {
@@ -12,26 +12,26 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 4 }} {{- toYaml .Values.podSecurityContext | nindent 4 }}
containers: containers:
- name: curl-service-name - name: curl-service-name
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-s', '-f', 'http://{{ include "spiffe-oidc-discovery-provider.fullname" . }}:{{ .Values.service.port }}/.well-known/openid-configuration'] args: ['-s', '-f', 'http://{{ include "spiffe-oidc-discovery-provider.fullname" . }}:{{ .Values.service.port }}/.well-known/openid-configuration']
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 8 }} {{- toYaml .Values.securityContext | nindent 8 }}
- name: curl-service-name-namespace - name: curl-service-name-namespace
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-s', '-f', 'http://{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}:{{ .Values.service.port }}/.well-known/openid-configuration'] args: ['-s', '-f', 'http://{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}:{{ .Values.service.port }}/.well-known/openid-configuration']
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 8 }} {{- toYaml .Values.securityContext | nindent 8 }}
- name: curl-service-name-namespace-svc-cluster-local - name: curl-service-name-namespace-svc-cluster-local
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-s', '-f', 'http://{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.service.port }}/.well-known/openid-configuration'] args: ['-s', '-f', 'http://{{ include "spiffe-oidc-discovery-provider.fullname" . }}.{{ include "spiffe-oidc-discovery-provider.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.service.port }}/.well-known/openid-configuration']
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 8 }} {{- toYaml .Values.securityContext | nindent 8 }}
{{- if .Values.ingress.enabled }} {{- if .Values.ingress.enabled }}
- name: curl-ingress - name: curl-ingress
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-s', '-f', 'http://{{ index .Values.config.domains 0 }}/.well-known/openid-configuration'] args: ['-s', '-f', 'http://{{ index .Values.config.domains 0 }}/.well-known/openid-configuration']
securityContext: securityContext:
@@ -200,3 +200,18 @@ ingress:
# - secretName: chart-example-tls # - secretName: chart-example-tls
# hosts: # hosts:
# - oidc-discovery.example.org # - oidc-discovery.example.org
# @ignored
tests:
bash:
image:
# -- The OCI registry to pull the tests image from
registry: cgr.dev
# -- The repository within the registry
repository: chainguard/bash
# -- The tests image pull policy
pullPolicy: IfNotPresent
# -- This value is deprecated in favor of tag. (Will be removed in a future release)
version: ""
# -- Overrides the image tag
tag: 5.2.15
@@ -12,7 +12,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 4 }} {{- toYaml .Values.podSecurityContext | nindent 4 }}
containers: containers:
- name: curl - name: curl
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['bash'] command: ['bash']
args: args:
- -c - -c
@@ -31,7 +31,7 @@ spec:
{{- toYaml .Values.securityContext | nindent 8 }} {{- toYaml .Values.securityContext | nindent 8 }}
{{- if eq (.Values.federation.enabled | toString) "true" }} {{- if eq (.Values.federation.enabled | toString) "true" }}
- name: curl-federation-bundle-endpoint - name: curl-federation-bundle-endpoint
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-k', '-s', '-f', 'https://{{ include "spire-server.fullname" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.federation.bundleEndpoint.port }}'] args: ['-k', '-s', '-f', 'https://{{ include "spire-server.fullname" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.federation.bundleEndpoint.port }}']
securityContext: securityContext:
@@ -13,13 +13,13 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 4 }} {{- toYaml .Values.podSecurityContext | nindent 4 }}
containers: containers:
- name: curl-tornjak-backend - name: curl-tornjak-backend
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.backend" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.port }}/api/tornjak/serverinfo'] args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.backend" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.port }}/api/tornjak/serverinfo']
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 8 }} {{- toYaml .Values.securityContext | nindent 8 }}
- name: curl-tornjak-backend-and-spire - name: curl-tornjak-backend-and-spire
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.backend" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.port }}/api/healthcheck'] args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.backend" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.port }}/api/healthcheck']
securityContext: securityContext:
@@ -370,3 +370,18 @@ tornjak:
# requests: # requests:
# cpu: 100m # cpu: 100m
# memory: 128Mi # memory: 128Mi
# @ignored
tests:
bash:
image:
# -- The OCI registry to pull the image from
registry: cgr.dev
# -- The repository within the registry
repository: chainguard/bash
# -- The image pull policy
pullPolicy: IfNotPresent
# -- This value is deprecated in favor of tag. (Will be removed in a future release)
version: ""
# -- Overrides the image tag
tag: 5.2.15
@@ -12,7 +12,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 4 }} {{- toYaml .Values.podSecurityContext | nindent 4 }}
containers: containers:
- name: curl-tornjak-frontend - name: curl-tornjak-frontend
image: cgr.dev/chainguard/bash:latest image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl'] command: ['curl']
args: ['-k', '-s', '-f', 'http://{{ include "tornjak-frontend.fullname" . }}.{{ include "tornjak-frontend.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.service.port }}/tornjak/serverinfo'] args: ['-k', '-s', '-f', 'http://{{ include "tornjak-frontend.fullname" . }}.{{ include "tornjak-frontend.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.service.port }}/tornjak/serverinfo']
securityContext: securityContext:
@@ -91,3 +91,18 @@ startupProbe:
failureThreshold: 6 failureThreshold: 6
# -- Success threshold count for startupProbe # -- Success threshold count for startupProbe
successThreshold: 1 successThreshold: 1
# @ignored
tests:
bash:
image:
# -- The OCI registry to pull the image from
registry: cgr.dev
# -- The repository within the registry
repository: chainguard/bash
# -- The image pull policy
pullPolicy: IfNotPresent
# -- This value is deprecated in favor of tag. (Will be removed in a future release)
version: ""
# -- Overrides the image tag
tag: 5.2.15