Skip to content

Commit

Permalink
Cleanup deployment template more
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom committed Aug 28, 2024
1 parent cb2b98f commit f2326a2
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions deploy/charts/version-checker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kind: Deployment
metadata:
name: {{ $chartname }}
labels:
{{ include "version-checker.labels" . | nindent 4 }}
{{- include "version-checker.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand Down Expand Up @@ -107,7 +107,6 @@ spec:
name: {{ $chartname }}
key: ecr.accessKeyID
{{- end -}}

{{- if .Values.ecr.secretAccessKey }}
- name: VERSION_CHECKER_ECR_SECRET_ACCESS_KEY
valueFrom:
Expand All @@ -122,7 +121,6 @@ spec:
name: {{ $chartname }}
key: ecr.sessionToken
{{- end -}}

{{- if .Values.docker.token }}
# Docker
- name: VERSION_CHECKER_DOCKER_TOKEN
Expand All @@ -145,16 +143,14 @@ spec:
name: {{ $chartname }}
key: docker.password
{{- end -}}

{{- if .Values.gcr.token }}
# GCR
- name: VERSION_CHECKER_GCR_TOKEN
valueFrom:
secretKeyRef:
name: {{ $chartname }}
key: gcr.token
{{- end }}

{{- end -}}
{{- if .Values.ghcr.token }}
# GHCR
- name: VERSION_CHECKER_GHCR_TOKEN
Expand All @@ -163,7 +159,6 @@ spec:
name: {{ $chartname }}
key: ghcr.token
{{- end -}}

{{- if .Values.quay.token }}
# Quay
- name: VERSION_CHECKER_QUAY_TOKEN
Expand All @@ -172,7 +167,6 @@ spec:
name: {{ $chartname }}
key: quay.token
{{- end -}}

{{range $index, $element := .Values.selfhosted }}
# Selfhosted
{{- if $element.host }}
Expand All @@ -181,38 +175,38 @@ spec:
secretKeyRef:
name: {{ $chartname }}
key: selfhosted.{{ $element.name }}.host
{{- end }}
{{- end -}}
{{- if $element.username }}
- name: VERSION_CHECKER_SELFHOSTED_USERNAME_{{ $element.name }}
valueFrom:
secretKeyRef:
name: {{ $chartname }}
key: selfhosted.{{ $element.name }}.username
{{- end }}
{{- end -}}
{{- if $element.password }}
- name: VERSION_CHECKER_SELFHOSTED_PASSWORD_{{ $element.name }}
valueFrom:
secretKeyRef:
name: {{ $chartname }}
key: selfhosted.{{ $element.name }}.password
{{- end }}
{{- end -}}
{{- if $element.token }}
- name: VERSION_CHECKER_SELFHOSTED_TOKEN_{{ $element.name }}
valueFrom:
secretKeyRef:
name: {{ $chartname }}
key: selfhosted.{{ $element.name }}.token
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
{{- if .Values.env }}
{{- toYaml .Values.env | nindent 8 }}
{{- end }}
{{- end -}}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $secretEnabled }}
volumes:
{{- if $secretEnabled }}
- name: {{ include "version-checker.name" . }}
secret:
secretName: {{ include "version-checker.name" . }}
Expand Down

0 comments on commit f2326a2

Please sign in to comment.