Merge pull request #24919 from kargakis/avoid-panic-in-mapper

kubectl: avoid panic with nil gvk
pull/6/head
Robert Bailey 2016-05-06 15:07:05 -07:00
commit 385ae07bc6
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ type Mapper struct {
func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
versions := &runtime.VersionedObjects{}
_, gvk, err := m.Decode(data, nil, versions)
if err != nil {
return nil, fmt.Errorf("unable to decode %q: %v", source, err)
}
var obj runtime.Object
var versioned runtime.Object
if registered.IsThirdPartyAPIGroupVersion(gvk.GroupVersion()) {