pull/12523/merge
WrenIX 1 year ago committed by GitHub
commit ab54a48d14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -108,13 +108,30 @@ const defaultValues = `# Default values for %s.
replicaCount: 1 replicaCount: 1
global:
image:
# if set it will overwrite all registry entries
registry: ""
# if set it will overwrite all pullPolicy
pullPolicy:
image: image:
repository: nginx registry: docker.io
repository: library/nginx
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion. # Overrides the image tag whose default is the chart appVersion.
tag: "" tag: ""
imagePullSecrets: [] imagePullSecrets: []
testConnection:
enabled: true
image:
registry: docker.io
repository: library/busybox
# default without any tag
tag: ""
nameOverride: "" nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
@ -335,8 +352,10 @@ spec:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" {{- with .Values.image }}
imagePullPolicy: {{ .Values.image.pullPolicy }} image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ coalesce .Values.global.image.pullPolicy .pullPolicy }}
{{- end }}
ports: ports:
- name: http - name: http
containerPort: {{ .Values.service.port }} containerPort: {{ .Values.service.port }}
@ -523,7 +542,10 @@ Create the name of the service account to use
{{- end }} {{- end }}
` `
const defaultTestConnection = `apiVersion: v1 const defaultTestConnection = `{{- with .Values.testConnection }}
{{- if .enabled }}
---
apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: "{{ include "<CHARTNAME>.fullname" . }}-test-connection" name: "{{ include "<CHARTNAME>.fullname" . }}-test-connection"
@ -534,10 +556,15 @@ metadata:
spec: spec:
containers: containers:
- name: wget - name: wget
image: busybox {{- with .image }}
image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}{{ if .tag }}{{ printf ":%s" .tag }}{{ end }}
imagePullPolicy: {{ coalesce $.Values.global.pullPolicy .pullPolicy }}
{{- end }}
command: ['wget'] command: ['wget']
args: ['{{ include "<CHARTNAME>.fullname" . }}:{{ .Values.service.port }}'] args: ['{{ include "<CHARTNAME>.fullname" $ }}:{{ $.Values.service.port }}']
restartPolicy: Never restartPolicy: Never
{{- end }}{{/* end-if enabled */}}
{{- end }}{{/* end-with testConnection*/}}
` `
// Stderr is an io.Writer to which error messages can be written // Stderr is an io.Writer to which error messages can be written

Loading…
Cancel
Save