Add resource exists error on spec validate (#1506)

Co-authored-by: Anubhav <50611570+anubhav6663@users.noreply.github.com>
This commit is contained in:
Ta-Ching Chen
2020-01-27 19:09:35 +08:00
committed by GitHub
co-authored by Anubhav
parent 520cc0e130
commit 1e8148c051
5 changed files with 171 additions and 39 deletions
+2 -7
View File
@@ -115,14 +115,9 @@ func (opts *ApplySubCommand) run(input cli.Input) error {
return errors.Wrap(err, "error reading specs")
}
var warnings []string
// validate
warnings, err = fr.Validate(input)
err = Validate(input)
if err != nil {
return errors.Wrap(err, "error validating specs")
}
for _, warning := range warnings {
console.Warn(warning)
return errors.Wrap(err, "abort applying resources")
}
// make changes to the cluster based on the specs