Files
warewulf/internal/app/wwctl/image/delete/main.go
Jonathon Anderson 73a8ef8e0e Refactor wwctl <node|profile> edit and fix bugs
`wwctl node edit` appears to not be working properly since MergeNode. This
refactor, partly towards #918, resolves the issues with `node edit` and updates
`profile edit` to match.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-01-19 13:02:18 -07:00

27 lines
521 B
Go

package delete
import (
"fmt"
"github.com/warewulf/warewulf/internal/pkg/api/image"
"github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/warewulf/warewulf/internal/pkg/util"
"github.com/spf13/cobra"
)
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
cdp := &wwapiv1.ImageDeleteParameter{
ImageNames: args,
}
if !SetYes {
yes := util.Confirm(fmt.Sprintf("Are you sure you want to delete image %s", args))
if !yes {
return
}
}
return image.ImageDelete(cdp)
}