From 95bc109d432d7af8c13e0ccfd785fdec6f80495c Mon Sep 17 00:00:00 2001 From: Gerard Nguyen Date: Thu, 18 Apr 2024 22:31:55 +1000 Subject: [PATCH] error on missing required config --- cmd/kots/cli/template.go | 5 ++++- pkg/kotsadmconfig/config.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/kots/cli/template.go b/cmd/kots/cli/template.go index a9c98d42c1..6e85886453 100644 --- a/cmd/kots/cli/template.go +++ b/cmd/kots/cli/template.go @@ -268,7 +268,10 @@ func pullAndRender(appSlug string, licensePath string, configPath string, localP upstream := pull.RewriteUpstream(appSlug) _, err = pull.Pull(upstream, pullOptions) - if err != nil && err != pull.ErrConfigNeeded { + if err != nil { + if err == pull.ErrConfigNeeded { + return errors.New("missing required config values to render templates") + } return errors.Wrap(err, "failed to pull upstream") } diff --git a/pkg/kotsadmconfig/config.go b/pkg/kotsadmconfig/config.go index 3b335ffa38..56c2b33ac8 100644 --- a/pkg/kotsadmconfig/config.go +++ b/pkg/kotsadmconfig/config.go @@ -89,6 +89,7 @@ func NeedsConfiguration(appSlug string, sequence int64, isAirgap bool, kotsKinds } for _, item := range group.Items { if IsRequiredItem(item) && IsUnsetItem(item) { + log.Info("config item %q is required but not set", item.Name) return true, nil } }