Skip to content

Commit

Permalink
BUG: kubernetes-ingress: Replace tpl with default
Browse files Browse the repository at this point in the history
Since `tpl` expects a string, passing an unqouted, fully-numeric image tag
value results in a helm templating error, e.g.:

```
INFO[0000] install.go:214: [debug] Original chart version: ""
install.go:231: [debug] CHART PATH:
/home/mcampbell/github/coreweave/api-gateway/integration_tests

Error: template:
cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml:91:74:
executing
"cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml"
at <.Values.controller.image.tag>: wrong type for value; expected
string; got int64
helm.go:84: [debug] template:
cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml:91:74:
executing
"cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml"
at <.Values.controller.image.tag>: wrong type for value; expected
string; got int64  subtask=0 task=Render
std out err:
%!(EXTRA *errors.errorString=install.go:214: [debug] Original chart
version: ""
install.go:231: [debug] CHART PATH:
/home/mcampbell/github/coreweave/api-gateway/integration_tests

Error: template:
cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml:91:74:
executing
"cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml"
at <.Values.controller.image.tag>: wrong type for value; expected
string; got int64
helm.go:84: [debug] template:
cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml:91:74:
executing
"cloud-integration-tests/charts/cloud-app/charts/api-gateway/charts/kubernetes-ingress/templates/controller-deployment.yaml"
at <.Values.controller.image.tag>: wrong type for value; expected
string; got int64
```
  • Loading branch information
mecampbellsoup committed May 23, 2024
1 parent 136ab3a commit c6f65c2
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion haproxy/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HAProxy has been has been successfully installed. This Chart is used to run HAProxy as a regular application,
as opposed to HAProxy Ingress Controller Chart.

Controller image deployed is: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}".
Controller image deployed is: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}".
Your HAProxy app is of a "{{ .Values.kind }}" kind.

Service ports mapped are:
Expand Down
2 changes: 1 addition & 1 deletion haproxy/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spec:
{{- if .Values.securityContext.enabled }}
securityContext: {{- omit .Values.securityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.args.enabled }}
args:
Expand Down
2 changes: 1 addition & 1 deletion haproxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
{{- if .Values.securityContext.enabled }}
securityContext: {{- omit .Values.securityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.args.enabled }}
args:
Expand Down
3 changes: 2 additions & 1 deletion haproxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ serviceAccount:
## Default values for image
image:
repository: haproxytech/haproxy-alpine # can be changed to use CE or EE images
tag: "{{ .Chart.AppVersion }}"
# Overrides the image tag whose default is the chart appVersion
tag: ""
pullPolicy: IfNotPresent

## Automatically Roll Deployments
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-ingress/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HAProxy Kubernetes Ingress Controller has been successfully installed.

Controller image deployed is: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}".
Controller image deployed is: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }}".
Your controller is of a "{{ .Values.controller.kind }}" kind. Your controller service is running as a "{{ .Values.controller.service.type }}" type.
{{- if .Values.rbac.create}}
RBAC authorization is enabled.
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-ingress/templates/controller-crdjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
{{- end }}
containers:
- name: crd
image: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}"
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
command:
- /haproxy-ingress-controller
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-ingress/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
{{- end }}
containers:
- name: {{ include "kubernetes-ingress.name" . }}-{{ .Values.controller.name }}
image: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}"
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
args:
{{- if .Values.controller.defaultTLSSecret.enabled -}}
Expand Down
2 changes: 1 addition & 1 deletion kubernetes-ingress/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
{{- end }}
containers:
- name: {{ include "kubernetes-ingress.name" . }}-{{ .Values.controller.name }}
image: "{{ .Values.controller.image.repository }}:{{ tpl .Values.controller.image.tag . }}"
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
args:
{{- if .Values.controller.defaultTLSSecret.enabled -}}
Expand Down
3 changes: 2 additions & 1 deletion kubernetes-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ controller:
name: controller
image:
repository: haproxytech/kubernetes-ingress # can be changed to use CE or EE Controller images
tag: "{{ .Chart.AppVersion }}"
# Overrides the image tag whose default is the chart appVersion
tag: ""
pullPolicy: IfNotPresent

## Deployment or DaemonSet pod mode
Expand Down

0 comments on commit c6f65c2

Please sign in to comment.