mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #36753 from deads2k/cli-08-fix-watch
Automatic merge from submit-queue let printer update unstructured list Fixes https://github.com/kubernetes/kubernetes/issues/36749. Didn't see any existing test in `test-cmd.sh` and I'm not sure how to make the watch stop in the test for reasonable testing. @kubernetes/kubectl @kargakis
This commit is contained in:
commit
9d4f6d19f1
@ -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
|
||||
// trying to print, since the printers are keyed by type. This is extremely expensive.
|
||||
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 decodedObj, err := runtime.Decode(api.Codecs.UniversalDecoder(), objBytes); err == nil {
|
||||
obj = decodedObj
|
||||
|
Loading…
Reference in New Issue
Block a user