Insert namespace after validating the specs (#3164)

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
This commit is contained in:
soharab-ic
2025-02-07 15:49:16 +05:30
committed by GitHub
parent 3e253c2ee4
commit 5eed09a8fc
+5 -5
View File
@@ -177,11 +177,6 @@ func (opts *ApplySubCommand) run(input cli.Input) error {
return errors.Wrap(err, "error reading specs")
}
err = opts.insertNamespace(input, fr)
if err != nil {
return errors.Wrap(err, "error reading specs")
}
if validateSpecs {
err = validateForApply(input, fr)
if err != nil {
@@ -189,6 +184,11 @@ func (opts *ApplySubCommand) run(input cli.Input) error {
}
}
err = opts.insertNamespace(input, fr)
if err != nil {
return errors.Wrap(err, "error inserting namespace")
}
err = warnIfDirtyWorkTree(filepath.Clean(specDir + "/.."))
if err != nil {
console.Warn(err.Error())