mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Enable kubectl label resource type bash completion
This commit is contained in:
		@@ -64,6 +64,8 @@ $ kubectl label pods foo bar-`
 | 
			
		||||
 | 
			
		||||
func NewCmdLabel(f *cmdutil.Factory, out io.Writer) *cobra.Command {
 | 
			
		||||
	options := &LabelOptions{}
 | 
			
		||||
	p := kubectl.NewHumanReadablePrinter(false, false, false, false, []string{})
 | 
			
		||||
	validArgs := p.HandledResources()
 | 
			
		||||
 | 
			
		||||
	cmd := &cobra.Command{
 | 
			
		||||
		Use:     "label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]",
 | 
			
		||||
@@ -74,6 +76,7 @@ func NewCmdLabel(f *cmdutil.Factory, out io.Writer) *cobra.Command {
 | 
			
		||||
			err := RunLabel(f, out, cmd, args, options)
 | 
			
		||||
			cmdutil.CheckErr(err)
 | 
			
		||||
		},
 | 
			
		||||
		ValidArgs: validArgs,
 | 
			
		||||
	}
 | 
			
		||||
	cmdutil.AddPrinterFlags(cmd)
 | 
			
		||||
	cmd.Flags().Bool("overwrite", false, "If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user