Skip to content

Commit

Permalink
error on missing required config
Browse files Browse the repository at this point in the history
  • Loading branch information
nvanthao committed Jul 4, 2024
1 parent ac65854 commit c9d3ef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/kots/cli/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
1 change: 1 addition & 0 deletions pkg/kotsadmconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit c9d3ef3

Please sign in to comment.