mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Get printer from factory instead of using NewHumanReadablePrinter to retrieve handled resources
This commit is contained in:
@@ -67,11 +67,16 @@ $ kubectl delete pods --all`
|
||||
)
|
||||
|
||||
func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
p := kubectl.NewHumanReadablePrinter(false, false, false, false, []string{})
|
||||
validArgs := p.HandledResources()
|
||||
|
||||
options := &DeleteOptions{}
|
||||
|
||||
// retrieve a list of handled resources from printer as valid args
|
||||
validArgs := []string{}
|
||||
p, err := f.Printer(nil, false, false, false, false, []string{})
|
||||
cmdutil.CheckErr(err)
|
||||
if p != nil {
|
||||
validArgs = p.HandledResources()
|
||||
}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])",
|
||||
Short: "Delete resources by filenames, stdin, resources and names, or by resources and label selector.",
|
||||
|
||||
Reference in New Issue
Block a user