mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #113244 from SataQiu/print-detail-20221021
kubeadm: print the detailed manifest info when decoding it into runtime.Object fails
This commit is contained in:
commit
e876d63ec2
@ -70,7 +70,11 @@ func UnmarshalFromYamlForCodecs(buffer []byte, gv schema.GroupVersion, codecs se
|
|||||||
}
|
}
|
||||||
|
|
||||||
decoder := codecs.DecoderToVersion(info.Serializer, gv)
|
decoder := codecs.DecoderToVersion(info.Serializer, gv)
|
||||||
return runtime.Decode(decoder, buffer)
|
obj, err := runtime.Decode(decoder, buffer)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "failed to decode %s into runtime.Object", buffer)
|
||||||
|
}
|
||||||
|
return obj, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SplitYAMLDocuments reads the YAML bytes per-document, unmarshals the TypeMeta information from each document
|
// SplitYAMLDocuments reads the YAML bytes per-document, unmarshals the TypeMeta information from each document
|
||||||
|
Loading…
Reference in New Issue
Block a user