haproxytech / helm-charts

Helm chart for HAProxy Kubernetes Ingress Controller
Apache License 2.0
155 stars 121 forks source link

BUG: kubernetes-ingress: Remove unneeded tpl function #243

Closed mecampbellsoup closed 6 months ago

mecampbellsoup commented 6 months ago

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
dkorunic commented 6 months ago

This PR is not going to be accepted as it would break things. tpl is intended to render .Chart.AppVersion in controller.image.tag (https://github.com/haproxytech/helm-charts/blob/e1e93595153b326992bd4f2a3d54cb7af48d08aa/kubernetes-ingress/values.yaml#L64C10-L64C35) with a value from Helm that's set in Chart.yaml as appVersion (https://github.com/haproxytech/helm-charts/blob/e1e93595153b326992bd4f2a3d54cb7af48d08aa/kubernetes-ingress/Chart.yaml#L20C1-L20C11) so that we don't hardcode latest version in values.yaml, but in Chart.yaml as it is common practice and a preferred way of doing things.