code: 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)
  	}
  	mapping, err := m.RESTMapping(gvk.GroupKind(), gvk.Version)
  	if err != nil {
  		return nil, fmt.Errorf("unable to recognize %q: %v", source, err)
  	}
  
  	client, err := m.ClientForMapping(mapping)
  	if err != nil {
  		return nil, fmt.Errorf("unable to connect to a server to handle %q: %v", mapping.Resource, err)
  	}
  
  	// TODO: decoding the version object is convenient, but questionable. This is used by apply
  	// and rolling-update today, but both of those cases should probably be requesting the raw
  	// object and performing their own decoding.
  	obj, versioned := versions.Last(), versions.First()
  	name, _ := mapping.MetadataAccessor.Name(obj)
  	namespace, _ := mapping.MetadataAccessor.Namespace(obj)
  	resourceVersion, _ := mapping.MetadataAccessor.ResourceVersion(obj)
  
  	return &Info{
  		Mapping:         mapping,
  		Client:          client,
  		Namespace:       namespace,
  		Name:            name,
  		Source:          source,
  		VersionedObject: versioned,
  		Object:          obj,
  		ResourceVersion: resourceVersion,
  	}, nil
  }
docs: // InfoForData creates an Info object for the given data. An error is returned
  // if any of the decoding or client lookup steps fail. Name and namespace will be
  // set into Info if the mapping's MetadataAccessor can retrieve them.