mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Make ShowManagedFields public so printers users can tweak the value
This commit is contained in:
parent
8e5089ad17
commit
47d8450c90
@ -36,7 +36,7 @@ func (f *JSONYamlPrintFlags) AllowedFormats() []string {
|
||||
// Given the following flag values, a printer can be requested that knows
|
||||
// how to handle printing based on these values.
|
||||
type JSONYamlPrintFlags struct {
|
||||
showManagedFields bool
|
||||
ShowManagedFields bool
|
||||
}
|
||||
|
||||
// ToPrinter receives an outputFormat and returns a printer capable of
|
||||
@ -56,7 +56,7 @@ func (f *JSONYamlPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePr
|
||||
return nil, NoCompatiblePrinterError{OutputFormat: &outputFormat, AllowedFormats: f.AllowedFormats()}
|
||||
}
|
||||
|
||||
if !f.showManagedFields {
|
||||
if !f.ShowManagedFields {
|
||||
printer = &printers.OmitManagedFieldsPrinter{Delegate: printer}
|
||||
}
|
||||
return printer, nil
|
||||
@ -69,7 +69,7 @@ func (f *JSONYamlPrintFlags) AddFlags(c *cobra.Command) {
|
||||
return
|
||||
}
|
||||
|
||||
c.Flags().BoolVar(&f.showManagedFields, "show-managed-fields", f.showManagedFields, "If true, keep the managedFields when printing objects in JSON or YAML format.")
|
||||
c.Flags().BoolVar(&f.ShowManagedFields, "show-managed-fields", f.ShowManagedFields, "If true, keep the managedFields when printing objects in JSON or YAML format.")
|
||||
}
|
||||
|
||||
// NewJSONYamlPrintFlags returns flags associated with
|
||||
|
Loading…
Reference in New Issue
Block a user