Skip to content

Commit

Permalink
fix: chart tpl when rendering feature gate flag (#760)
Browse files Browse the repository at this point in the history
k=v pair should be joint by comma.

---------

Signed-off-by: jerryzhuang <zhuangqhc@gmail.com>
  • Loading branch information
zhuangqh authored Dec 6, 2024
1 parent 57bfd72 commit d6f8602
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/kaito/workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export REGISTRY=mcr.microsoft.com/aks/kaito
export IMG_NAME=workspace
export IMG_TAG=0.4.0
helm install workspace ./charts/kaito/workspace \
--set image.repository=${REGISTRY}/$(IMG_NAME) --set image.tag=$(IMG_TAG) \
--set image.repository=${REGISTRY}/${IMG_NAME} --set image.tag=${IMG_TAG} \
--namespace kaito-workspace --create-namespace
```

Expand Down
11 changes: 11 additions & 0 deletions charts/kaito/workspace/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,14 @@ Selector labels
app.kubernetes.io/name: {{ include "kaito.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Utils function
*/}}
{{- define "utils.joinKeyValuePairs" -}}
{{- $pairs := list -}}
{{- range $key, $value := . -}}
{{- $pairs = append $pairs (printf "%s=%s" $key $value) -}}
{{- end -}}
{{- join "," $pairs -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/kaito/workspace/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- --feature-gates={{- range $k, $v := .Values.featureGates }}{{ $k }}={{ $v}}{{- end }}
- --feature-gates={{ include "utils.joinKeyValuePairs" .Values.featureGates }}
env:
- name: WEBHOOK_SERVICE
value: {{ include "kaito.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before:
- go mod tidy
builds:
- id: kaito
main: ./cmd
main: ./cmd/workspace/
binary: bin/kaito
goos:
- linux
Expand Down

0 comments on commit d6f8602

Please sign in to comment.