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:
@@ -25,6 +25,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 {
|
||||
@@ -43,6 +44,9 @@ func (opts *DeleteSubCommand) do(input cli.Input) error {
|
||||
|
||||
err := opts.Client().V1().Function().Delete(m)
|
||||
if err != nil {
|
||||
if input.Bool(flagkey.IgnoreNotFound) && util.IsNotFound(err) {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, fmt.Sprintf("delete function '%v'", m.Name))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user