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:
WanLinghao
2018-04-12 12:50:15 +08:00
parent 62b58e625e
commit a2c029f6c3
2 changed files with 30 additions and 0 deletions

View File

@@ -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
}