helm: helm lint: [WARNING] templates/: directory not found

Output of helm version:

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

Some charts don’t need a templates directory; we have real-world examples in our project. Nevertheless, these cause helm lint to display a warning in our CI pipeline. One might think the solution is simple enough: just add a templates directory. But empty directories can’t be added in Git, so one would have to employ some kind of hacky ad-hoc workaround with an empty .gitignore or something. Not very practical.

I don’t know what solution to suggest, but this is a bit of an issue for us, so I’ll post it here and see where the discussion takes us.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 38 (24 by maintainers)

Commits related to this issue

Most upvoted comments

I’d like to see a solution to this too. We intentionally do not have a templates/ directory for multiple deployments because we are just passing values to dependencies. If we use the --strict option, that causes failures in our CI/CD pipeline. For now, I’m only using --strict for deployments with templates to catch issues with deprecated K8s resources. Would love to be able to use it across the board though.

Thanks for raising again @lindhe. I mis-read issue #8418 and even though it has similarities to this, they are different issues. I am going to re-open this issue and raise it at the dev weekly meeting today on how best to proceed.

Hey Team - I’ve had a go at resolving this issue via #11586. There are some test failures coming back from CircleCI due to golden test data comparisons and just removing the warning from the golden test data doesn’t resolve it as further differences are emerging.

Before I go too much further I’m definitely keen for any gentle guidance on the preferred way of addressing those 🙏🏻

Strange. I tried it now with v3.4.0-rc.1 and the warning is still there. What am I missing?

Setup

Chart.yaml:

apiVersion: v2
name: a
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: 1.16.0
icon: https://artifacthub.io/image/681732c0-8168-4b95-8600-894449c02b79@1x.png
dependencies:
- name: nginx
  version: 7.1.3
  repository: "https://charts.bitnami.com/bitnami"

Commands:

$ h version
version.BuildInfo{Version:"v3.4.0-rc.1", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"clean", GoVersion:"go1.14.10"}

$ h dep update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading nginx from repo https://charts.bitnami.com/bitnami
Deleting outdated charts

$ h lint .
==> Linting .
[WARNING] templates/: directory not found

1 chart(s) linted, 0 chart(s) failed

$ tree
.
├── Chart.lock
├── charts
│   └── nginx-7.1.3.tgz
├── Chart.yaml
└── values.yaml

1 directory, 4 files

@lindhe @dntosas This should be fixed by changes in PR #7970 which will be in 3.4.0 release. You can test against main branch to see if it works. It is also similar to issue #8418.

I am therefore going to close this issue and we can re-open if need be.

My most common use-case for not having templates/ is when I put together an umbrella chart (with dependencies) that doesn’t have any template files of its own.

Yes, meant to add that to https://github.com/helm/helm/issues/8033#issuecomment-624534020 to show when it is ok to have no template directory

Maybe we need instead some logic in Helm which checks for an application chart with nothing to deploy?

That sounds like it would make a lot of sense. My most common use-case for not having templates/ is when I put together an umbrella chart (with dependencies) that doesn’t have any template files of its own. And it sounds like that would be correctly handled by your suggestion! And not creating a release without anything to deploy sounds like an error case…

All in all, I like it!