Add support for applying set of resources via kubectl

Discussion: https://github.com/GoogleCloudPlatform/kubernetes/issues/1905
For both today, until we remove that from codec.  At that point though we would have a client pipeline that would attempt to transform YAML to JSON if necessary prior to this steps


> On Nov 3, 2014, at 10:20 PM, bgrant0607 <notifications@github.com> wrote:
> 
> In pkg/kubectl/cmd/apply.go:
> 
> > +	//			'default' apiVersion for all items.
> > +	runtime.TypeMeta `yaml:",inline" json:",inline"`
> > +	Items            []runtime.RawExtension `json:"items" yaml:"items"`
> > +}
> > +
> > +// DataToObjects converts the raw JSON data into API objects
> > +func DataToObjects(m meta.RESTMapper, t runtime.ObjectTyper, data []byte) (result []runtime.Object, errors errs.ValidationErrorList) {
> > +	configObj := InternalConfig{}
> > +
> > +	if err := yaml.Unmarshal(data, &configObj); err != nil {
> > +		errors = append(errors, errs.NewFieldInvalid("format", err))
> > +		return result, errors.Prefix("Config")
> > +	}
> > +
> > +	for i, in := range configObj.Items {
> > +		version, kind, err := t.DataVersionAndKind(in.RawJSON)
> Does this work for YAML, also, or only JSON?
> 
> —
> Reply to this email directly or view it on GitHub.