mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Kubectl: Move no-headers flag get out of for loop
This commit is contained in:
parent
8583b6639d
commit
7cccb94edb
@ -308,6 +308,7 @@ func (options *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []str
|
|||||||
}
|
}
|
||||||
|
|
||||||
filteredResourceCount := 0
|
filteredResourceCount := 0
|
||||||
|
noHeaders := cmdutil.GetFlagBool(cmd, "no-headers")
|
||||||
for ix := range objs {
|
for ix := range objs {
|
||||||
var mapping *meta.RESTMapping
|
var mapping *meta.RESTMapping
|
||||||
var original runtime.Object
|
var original runtime.Object
|
||||||
@ -350,7 +351,6 @@ func (options *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []str
|
|||||||
// TODO: this doesn't belong here
|
// TODO: this doesn't belong here
|
||||||
// add linebreak between resource groups (if there is more than one)
|
// add linebreak between resource groups (if there is more than one)
|
||||||
// skip linebreak above first resource group
|
// skip linebreak above first resource group
|
||||||
noHeaders := cmdutil.GetFlagBool(cmd, "no-headers")
|
|
||||||
if lastMapping != nil && !noHeaders {
|
if lastMapping != nil && !noHeaders {
|
||||||
fmt.Fprintf(options.ErrOut, "%s\n", "")
|
fmt.Fprintf(options.ErrOut, "%s\n", "")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user