mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-02 09:47:06 +00:00
let printer update unstructured list
This commit is contained in:
@@ -2318,7 +2318,7 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er
|
|||||||
// check if the object is unstructured. If so, let's attempt to convert it to a type we can understand before
|
// check if the object is unstructured. If so, let's attempt to convert it to a type we can understand before
|
||||||
// trying to print, since the printers are keyed by type. This is extremely expensive.
|
// trying to print, since the printers are keyed by type. This is extremely expensive.
|
||||||
switch obj.(type) {
|
switch obj.(type) {
|
||||||
case *runtime.Unstructured, *runtime.Unknown:
|
case *runtime.UnstructuredList, *runtime.Unstructured, *runtime.Unknown:
|
||||||
if objBytes, err := runtime.Encode(api.Codecs.LegacyCodec(), obj); err == nil {
|
if objBytes, err := runtime.Encode(api.Codecs.LegacyCodec(), obj); err == nil {
|
||||||
if decodedObj, err := runtime.Decode(api.Codecs.UniversalDecoder(), objBytes); err == nil {
|
if decodedObj, err := runtime.Decode(api.Codecs.UniversalDecoder(), objBytes); err == nil {
|
||||||
obj = decodedObj
|
obj = decodedObj
|
||||||
|
Reference in New Issue
Block a user