diff --git a/cli/app/deploy.go b/cli/app/deploy.go index aa8b4062..72e45a58 100644 --- a/cli/app/deploy.go +++ b/cli/app/deploy.go @@ -108,7 +108,11 @@ checkout as-is. Recipe commit hashes are also supported as values for } if err := lint.LintForErrors(app.Recipe); err != nil { - log.Fatal(err) + if internal.Chaos { + log.Warn(err) + } else { + log.Fatal(err) + } } if err := validateSecrets(cl, app); err != nil { diff --git a/pkg/lint/recipe.go b/pkg/lint/recipe.go index 4f7f5e24..ae462a54 100644 --- a/pkg/lint/recipe.go +++ b/pkg/lint/recipe.go @@ -184,6 +184,8 @@ var LintRules = map[string][]LintRule{ func LintForErrors(recipe recipe.Recipe) error { log.Debugf("linting for critical errors in %s configs", recipe.Name) + var errors string + for level := range LintRules { if level != "error" { continue @@ -196,14 +198,18 @@ func LintForErrors(recipe recipe.Recipe) error { ok, err := rule.Function(recipe) if err != nil { - return fmt.Errorf("lint %s: %s", rule.Ref, err) + errors += fmt.Sprintf("\nlint %s: %s", rule.Ref, err) } if !ok { - return fmt.Errorf("lint error in %s configs: \"%s\" failed lint checks (%s)", recipe.Name, rule.Description, rule.Ref) + errors += fmt.Sprintf("\nlint error in %s configs: \"%s\" failed lint checks (%s)", recipe.Name, rule.Description, rule.Ref) } } } + if (len(errors) > 0) { + return fmt.Errorf(errors[1:]) + } + log.Debugf("linting successful, %s is well configured", recipe.Name) return nil