Added ignorenotfound flag for all resources' deletion (#2293)
Treat \"resource not found\" as a successful delete if ignorenotfound flag passed while deletion of Fission resource.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
)
|
||||
|
||||
type DeleteSubCommand struct {
|
||||
@@ -68,6 +69,9 @@ func (opts *DeleteSubCommand) run(input cli.Input) error {
|
||||
Name: opts.name,
|
||||
})
|
||||
if err != nil {
|
||||
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "find package")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user