mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
add labels to diff command
This commit is contained in:
parent
af67408c17
commit
75af2fca61
@ -95,6 +95,7 @@ type DiffOptions struct {
|
||||
FieldManager string
|
||||
ForceConflicts bool
|
||||
|
||||
Selector string
|
||||
OpenAPISchema openapi.Resources
|
||||
DiscoveryClient discovery.DiscoveryInterface
|
||||
DynamicClient dynamic.Interface
|
||||
@ -148,6 +149,7 @@ func NewCmdDiff(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C
|
||||
}
|
||||
|
||||
usage := "contains the configuration to diff"
|
||||
cmd.Flags().StringVarP(&options.Selector, "selector", "l", options.Selector, "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")
|
||||
cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage)
|
||||
cmdutil.AddServerSideApplyFlags(cmd)
|
||||
|
||||
@ -494,6 +496,7 @@ func (o *DiffOptions) Run() error {
|
||||
Unstructured().
|
||||
NamespaceParam(o.CmdNamespace).DefaultNamespace().
|
||||
FilenameParam(o.EnforceNamespace, &o.FilenameOptions).
|
||||
LabelSelectorParam(o.Selector).
|
||||
Flatten().
|
||||
Do()
|
||||
if err := r.Err(); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user