Skip to content

Commit

Permalink
charts: fix oidc external secret loading
Browse files Browse the repository at this point in the history
There was a wrong k8s config written for envFrom for external secret.

Fixes: #2022
Signed-off-by: Kautilya Tripathi <ktripathi@microsoft.com>
  • Loading branch information
knrt10 committed Jun 3, 2024
1 parent c0cb90f commit e48d9a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 7 additions & 5 deletions charts/headlamp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ spec:
image: "{{ .Values.image.registry}}/{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{ if or $oidc .Values.env }}
{{- if $oidc.externalSecret.enabled }}
# Check if externalSecret is enabled
envFrom:
- secretRef:
name: {{ $oidc.externalSecret.name }}
{{- else }}
env:
{{- if $oidc.secret.create }}
{{- if $oidc.clientID }}
Expand Down Expand Up @@ -91,11 +97,6 @@ spec:
name: {{ $oidc.secret.name }}
key: scopes
{{- end }}
{{- else if $oidc.externalSecret.enabled }}
# Check if externalSecret is enabled
envFrom:
- secretRef:
name: {{ $oidc.externalSecret.name }}
{{- else }}
{{- if $oidc.clientID }}
- name: OIDC_CLIENT_ID
Expand All @@ -118,6 +119,7 @@ spec:
{{- toYaml .Values.env | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
args:
- "-in-cluster"
{{- with .Values.config.pluginsDir}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ spec:
image: "ghcr.io/headlamp-k8s/headlamp:v0.24.0"
imagePullPolicy: IfNotPresent

env:
# Check if externalSecret is enabled
envFrom:
- secretRef:
name: oidc
# Check if externalSecret is enabled
envFrom:
- secretRef:
name: oidc
args:
- "-in-cluster"
- "-plugins-dir=/headlamp/plugins"
Expand Down

0 comments on commit e48d9a0

Please sign in to comment.