[WIP] Add support for applying a Config with set of resources via kubecfg

Discussion: https://github.com/GoogleCloudPlatform/kubernetes/issues/1905
Yes, as you noted elsewhere we should be able to split it out into a separate process/step.

----- Original Message -----
> > +		}
> > +		result = append(result, itemResult)
> > +	}
> > +	return
> > +}
> > +
> > +// AddConfigLabels adds new label(s) to all resources defined in the given
> > Config.
> > +func AddConfigLabels(c *api.Config, labels labels.Set) error {
> > +	for i := range c.Items {
> > +		switch t := c.Items[i].Object.(type) {
> > +		case *kubeapi.Pod:
> > +			if err := mergeMaps(&t.Labels, labels, ErrorOnDifferentDstKeyValue);
> > err != nil {
> > +				return fmt.Errorf("Unable to add labels to Template.Items[%v]
> > Pod.Labels: %v", i, err)
> > +			}
> > +		case *kubeapi.Service:
> > +			if err := mergeMaps(&t.Labels, labels, ErrorOnDifferentDstKeyValue);
> > err != nil {
> 
> Is this to add deployment-specific labels so that config templates can be
> reused across multiple deployments?
> 
> Are you also munging label selectors and names? If not, that's a bug. See
> #1698.
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/GoogleCloudPlatform/kubernetes/pull/1958/files#r19258445