From 921f69bae7b441d698d5aaf3af4086fb5d8eca1f Mon Sep 17 00:00:00 2001 From: Aaron Batilo Date: Sun, 29 Sep 2019 01:11:06 -0600 Subject: [PATCH] Warn users when no repositories are defined (#879) At the moment, if you have a helmfile.yaml like so: ``` releases: - name: metrics-server namespace: kube-system chart: stable/metrics-server ``` If you try to run `helmfile deps`, you will get a 0 exit code and no log output at whatsoever, signaling that there weren't any problems, but no lock file will get created. For example: ``` root@316073d4a104:/# helmfile deps root@316073d4a104:/# ``` This behavior doesn't appear to be documented and is unintuitive to the user. This change adds a warning output for this same use case: ``` root@316073d4a104:/# helmfile deps There are no repositories defined in your helmfile.yaml. This means helmfile cannot update your dependencies or create a lock file. See https://github.com/roboll/helmfile/issues/878 for more information. root@316073d4a104:/# ``` Fixes #878 --- pkg/state/chart_dependency.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/state/chart_dependency.go b/pkg/state/chart_dependency.go index 7b564b06..467e4795 100644 --- a/pkg/state/chart_dependency.go +++ b/pkg/state/chart_dependency.go @@ -195,6 +195,7 @@ func (st *HelmState) updateDependenciesInTempDir(shell helmexec.DependencyUpdate } if len(unresolved.deps) == 0 { + st.logger.Warnf("There are no repositories defined in your helmfile.yaml.\nThis means helmfile cannot update your dependencies or create a lock file.\nSee https://github.com/roboll/helmfile/issues/878 for more information.") return st, nil }