From ed228c9c7e6efe69e408b2bf8d41311d62ba47fe Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sat, 15 Oct 2022 14:22:51 +0800 Subject: [PATCH] move HELMFILE_UPGRADE_NOTICE_DISABLED into envvar file Signed-off-by: yxxhero --- cmd/root.go | 3 ++- pkg/envvar/const.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 8133b0ac..52627612 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,6 +12,7 @@ import ( "github.com/helmfile/helmfile/pkg/app" "github.com/helmfile/helmfile/pkg/app/version" "github.com/helmfile/helmfile/pkg/config" + "github.com/helmfile/helmfile/pkg/envvar" "github.com/helmfile/helmfile/pkg/errors" "github.com/helmfile/helmfile/pkg/helmexec" ) @@ -75,7 +76,7 @@ func NewRootCmd(globalConfig *config.GlobalOptions, args []string) (*cobra.Comma // when set environment HELMFILE_UPGRADE_NOTICE_DISABLED any value, skip upgrade notice. var versionOpts []extension.CobraOption - if os.Getenv("HELMFILE_UPGRADE_NOTICE_DISABLED") == "" { + if os.Getenv(envvar.UpgradeNoticeDisabled) == "" { versionOpts = append(versionOpts, extension.WithUpgradeNotice("helmfile", "helmfile")) } diff --git a/pkg/envvar/const.go b/pkg/envvar/const.go index ae1e8471..5161a3d4 100644 --- a/pkg/envvar/const.go +++ b/pkg/envvar/const.go @@ -6,3 +6,4 @@ const Experimental = "HELMFILE_EXPERIMENTAL" // environment variable for experim const Environment = "HELMFILE_ENVIRONMENT" const TempDir = "HELMFILE_TEMPDIR" const Helm3 = "HELMFILE_HELM3" +const UpgradeNoticeDisabled = "HELMFILE_UPGRADE_NOTICE_DISABLED"