mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
1.fix kubectl get * --all-namespaces
namespace miss error 2.also add a test case modified: pkg/kubectl/cmd/get/get.go modified: hack/make-rules/test-cmd-util.sh
This commit is contained in:
@@ -614,6 +614,22 @@ func (o *GetOptions) decodeIntoTable(encoder runtime.Encoder, obj runtime.Object
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for i := range table.Rows {
|
||||
row := &table.Rows[i]
|
||||
if row.Object.Raw == nil || row.Object.Object != nil {
|
||||
//if row already has Object.Object
|
||||
//we don't change it
|
||||
continue
|
||||
}
|
||||
|
||||
converted, err := runtime.Decode(unstructured.UnstructuredJSONScheme, row.Object.Raw)
|
||||
if err != nil {
|
||||
//if error happens, we just continue
|
||||
continue
|
||||
}
|
||||
row.Object.Object = converted
|
||||
}
|
||||
|
||||
return table, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user