fix: add correct flags when deleting resources from Dir (#2124)
parent
c4ef6006bd
commit
25a99d3f3a
|
|
@ -229,13 +229,23 @@ func (d *Dir) delCmd(evt *tcell.EventKey) *tcell.EventKey {
|
|||
return evt
|
||||
}
|
||||
|
||||
opts := []string{"-f"}
|
||||
msgRessource := "manifest"
|
||||
if containsDir(sel) {
|
||||
opts = append(opts, "-R")
|
||||
}
|
||||
if isKustomized(sel) {
|
||||
opts = []string{"-k"}
|
||||
msgRessource = "kustomization"
|
||||
}
|
||||
|
||||
d.Stop()
|
||||
defer d.Start()
|
||||
msg := fmt.Sprintf("Delete resource(s) in manifest %s", sel)
|
||||
msg := fmt.Sprintf("Delete resource(s) in %s %s", msgRessource, sel)
|
||||
dialog.ShowConfirm(d.App().Styles.Dialog(), d.App().Content.Pages, "Confirm Delete", msg, func() {
|
||||
args := make([]string, 0, 10)
|
||||
args = append(args, "delete")
|
||||
args = append(args, "-f")
|
||||
args = append(args, opts...)
|
||||
args = append(args, sel)
|
||||
res, err := runKu(d.App(), shellOpts{clear: false, args: args})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue