mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
tolerate missing column headers in server-side print output
This commit is contained in:
parent
dc5f615152
commit
bd559e247c
@ -371,6 +371,11 @@ func PrintTable(table *metav1beta1.Table, output io.Writer, options PrintOptions
|
|||||||
for _, row := range table.Rows {
|
for _, row := range table.Rows {
|
||||||
first := true
|
first := true
|
||||||
for i, cell := range row.Cells {
|
for i, cell := range row.Cells {
|
||||||
|
if i >= len(table.ColumnDefinitions) {
|
||||||
|
// https://issue.k8s.io/66379
|
||||||
|
// don't panic in case of bad output from the server, with more cells than column definitions
|
||||||
|
break
|
||||||
|
}
|
||||||
column := table.ColumnDefinitions[i]
|
column := table.ColumnDefinitions[i]
|
||||||
if !options.Wide && column.Priority != 0 {
|
if !options.Wide && column.Priority != 0 {
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user