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

Issue with go 1.14.0, Helm, 3.1.1 #7711

Closed
nicholasjackson opened this issue Mar 1, 2020 · 3 comments · Fixed by helm/charts#21888
Closed

Issue with go 1.14.0, Helm, 3.1.1 #7711

nicholasjackson opened this issue Mar 1, 2020 · 3 comments · Fixed by helm/charts#21888

Comments

@nicholasjackson
Copy link

Hi,

I am using Helm as a package from within my application (https://github.com/shipyard-run/shipyard/blob/master/pkg/clients/helm.go). When I upgraded Go to 1.14.0 I started to get the following error message.

2020-03-01T10:57:43.033Z [ERROR] Unable to apply blueprint: error="Error running chart: template: consul/templates/client-daemonset.yaml:121:23: executing "consul/templates/client-daemonset.yaml" at <(.Values.client.join) and (gt (len .Values.client.join) 0)>: can't give argument to non-function .Values.client.join"

I have tried to debug this but currently stumped, downgrading to Go 1.13.8 fixes the issue. Wondering if this is something to do with Go mod changes?

go version go1.13.8 linux/amd64
@bacongobbler
Copy link
Member

The text/template package now correctly reports errors when a parenthesized argument is used as a function. This most commonly shows up in erroneous cases like {{if (eq .F "a") or (eq .F "b")}}. This should be written as {{if or (eq .F "a") (eq .F "b")}}. The erroneous case never worked as expected, and will now be reported with an error can't give argument to non-function.

From https://golang.org/doc/go1.14

@mattfarina
Copy link
Collaborator

@nicholasjackson Can you make sure the chart your using doesn't have any issues with it. This may be your problem.

@nicholasjackson
Copy link
Author

Thank you so much,

This is exactly what is going on, I am no expert on go template and would never have spotted that as an error.

{{- if (.Values.client.join) and (gt (len .Values.client.join) 0) }}

Will report the issue to the template maintainer.

BTW, great work on Helm 3, I am loving the ability to embed it into my code as well as use from the CLI.

Kind regards,

Nic

ramaro pushed a commit to kapicorp/kapitan that referenced this issue Jun 10, 2020
* Fix go template in helm chart to be compatible with golang 1.14. helm/helm#7711

* Adds helm as a dependency manager

* Updates helm input to go 1.14

* Adds helm fetch binding to binary installation

* Upgrades travis distro to bionic since go 1.14 package is not available on xenial: https://launchpad.net/\~longsleep/+archive/ubuntu/golang-backports

* Removes specific gcc install not available on bionic as it may no longer be necessary for jsonnet binary

* Ensures helm_fetch.so is included in kapitan binary

* Adds binary test and fixes code formatting

* Adds debug logging for when helm_fetch_binding can't be imported

* Adds set -euo pipefail to explicitly fail build script if any step exits with a non 0 code

* Adds necessary dependencies to go.mod for helm_fetch

* Fixes test so sort order of list doesn't matter

* Makes chart_name required for helm dependency

* Adds defensive check on helm chart version. If not specified latest found will be downloaded

* Adds more complete example for helm dependency combined with helm input and test

* Gitignores .so and .h files

* Enhances documentation for helm dependency to show the output path structure
danail-branekov added a commit to cloudfoundry/eirini-release that referenced this issue Sep 9, 2020
After bumping helm to 2.16.10 template validation started failing.
Hopefully this change would make it happy

See helm/helm#7711 (comment)
jon-ruckwood added a commit to jon-ruckwood/camel-k that referenced this issue Jan 21, 2021
Additionally, add 'cluster' to fix type error.

See helm/helm#7711 (comment)
astefanutti pushed a commit to apache/camel-k that referenced this issue Jan 21, 2021
Additionally, add 'cluster' to fix type error.

See helm/helm#7711 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants