Skip to content

lookup function causes lint to fail #7955

Closed

Description

@seandilda

I've added a define to my _helpers.tpl that uses the lookup function (https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#using-the-lookup-function). Now when I run helm lint I get the following output:

[ERROR] templates/: parse error at (mariadb/templates/_helpers.tpl:62): function "lookup" not defined

Other than the lint failing, my chart is working great.

Output of helm version:

version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0+d4cacc0", GitCommit:"d4cacc0", GitTreeState:"clean", BuildDate:"2018-12-06T04:08:47Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

OKD 3.11

Activity

  1. added
    bug
    on Apr 20, 2020
  2. technosophos commented on Apr 20, 2020

    @technosophos
    Member

    I have reproduced and confirmed that this is a bug. It is caused by the conditional inclusion of lookup into the function map.

    Moreover, a second bug exists in lookup: It attempts to contact the Kubernetes API server during helm template calls, which is not allowed. And if no KUBECONFIG is set, lookup produces a lengthy error message.

    In both cases, the correct behavior is for lookup to return an empty dictionary regardless of what the input is. This follows the established pattern of other cluster-sensitive templating directives.

  3. technosophos commented on Apr 21, 2020

    @technosophos
    Member

    I am working on a fix.

  4. stefannica commented on Oct 14, 2020

    @stefannica

    @technosophos is there any chance the #7969 fix can be back-ported to helm 2 ? I tried to do that myself, but it's not a trivial cherry-pick and I'm not an advanced helm contributor.

  5. bacongobbler commented on Oct 14, 2020

    @bacongobbler
    Member

    Sorry @stefannica. We are no longer accepting bug fixes for Helm 2. Only security fixes. We are fully dropping Helm 2 support in just under a month's time.

    See https://helm.sh/blog/helm-v2-deprecation-timeline/ for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions