Skip to content

Commit

Permalink
Cleanup Helm Templates (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom authored Sep 2, 2024
1 parent d215b42 commit dece3df
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 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 @@ -72,8 +72,8 @@ spec:
name: {{.Values.existingSecret}}
{{- end }}
env:
# ACR
{{- if .Values.acr.refreshToken }}
# ACR
- name: VERSION_CHECKER_ACR_REFRESH_TOKEN
valueFrom:
secretKeyRef:
Expand All @@ -93,10 +93,10 @@ spec:
secretKeyRef:
name: {{ $chartname }}
key: acr.password
{{- end }}
{{- end -}}

# ECR
{{- if .Values.ecr.iamRoleArn }}
# ECR
- name: VERSION_CHECKER_ECR_IAM_ROLE_ARN
value: {{ .Values.ecr.iamRoleArn }}
{{- end }}
Expand All @@ -106,7 +106,7 @@ spec:
secretKeyRef:
name: {{ $chartname }}
key: ecr.accessKeyID
{{- end }}
{{- end -}}
{{- if .Values.ecr.secretAccessKey }}
- name: VERSION_CHECKER_ECR_SECRET_ACCESS_KEY
valueFrom:
Expand All @@ -120,10 +120,9 @@ spec:
secretKeyRef:
name: {{ $chartname }}
key: ecr.sessionToken
{{- end }}

# Docker
{{- end -}}
{{- if .Values.docker.token }}
# Docker
- name: VERSION_CHECKER_DOCKER_TOKEN
valueFrom:
secretKeyRef:
Expand All @@ -143,69 +142,65 @@ spec:
secretKeyRef:
name: {{ $chartname }}
key: docker.password
{{- end }}

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

# GHCR
{{- end -}}
{{- if .Values.ghcr.token }}
# GHCR
- name: VERSION_CHECKER_GHCR_TOKEN
valueFrom:
secretKeyRef:
name: {{ $chartname }}
key: ghcr.token
{{- end }}

# Quay
{{- end -}}
{{- if .Values.quay.token }}
# Quay
- name: VERSION_CHECKER_QUAY_TOKEN
valueFrom:
secretKeyRef:
name: {{ $chartname }}
key: quay.token
{{- end }}

# Selfhosted
{{- end -}}
{{range $index, $element := .Values.selfhosted }}
# Selfhosted
{{- if $element.host }}
- name: VERSION_CHECKER_SELFHOSTED_HOST_{{ $element.name }}
valueFrom:
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 }}
Expand Down

0 comments on commit dece3df

Please sign in to comment.