Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Helm Templates #215

Merged
merged 5 commits into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading