From c9d3ef329aa3fcc38ee3682228f18acf91c1cc5f 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 e887f5cb19..9a0981ddcd 100644 --- a/pkg/kotsadmconfig/config.go +++ b/pkg/kotsadmconfig/config.go @@ -84,6 +84,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 } }