Add Labels and Annotations to MetadataAccessor

MetadataAccessor shouldn't depend on this type in order to function.  In fact, if anyone still depends on runtime.TypeMets outside if a test it's wrong.


> On Nov 28, 2014, at 4:03 PM, Vojtech Vitek <notifications@github.com> wrote:
> 
> In pkg/runtime/types.go:
> 
> > @@ -38,12 +38,14 @@ type TypeMeta struct {
> >  	APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
> >  	Kind       string `json:"kind,omitempty" yaml:"kind,omitempty"`
> >  
> > -	Namespace         string    `json:"namespace,omitempty" yaml:"namespace,omitempty"`
> > -	Name              string    `json:"name,omitempty" yaml:"name,omitempty"`
> > -	UID               string    `json:"uid,omitempty" yaml:"uid,omitempty"`
> > -	CreationTimestamp util.Time `json:"creationTimestamp,omitempty" yaml:"creationTimestamp,omitempty"`
> > -	SelfLink          string    `json:"selfLink,omitempty" yaml:"selfLink,omitempty"`
> > -	ResourceVersion   string    `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
> > +	Namespace         string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
> > +	Name              string            `json:"name,omitempty" yaml:"name,omitempty"`
> > +	UID               string            `json:"uid,omitempty" yaml:"uid,omitempty"`
> > +	CreationTimestamp util.Time         `json:"creationTimestamp,omitempty" yaml:"creationTimestamp,omitempty"`
> > +	SelfLink          string            `json:"selfLink,omitempty" yaml:"selfLink,omitempty"`
> > +	ResourceVersion   string            `json:"resourceVersion,omitempty" yaml:"resourceVersion,omitempty"`
> > +	Labels            map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
> > +	Annotations       map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
> Alright. So, do you want me to change this struct to
> 
> type TypeMeta struct {
>   api.TypeMeta
>   api.ObjectMeta
> }
> instead?
> 
> Justification of this PR:
> I need MetadataAccessor to be able to read & write runtime.Object Labels. Then I could get rid of type-switches, as in https://github.com/openshift/origin/blob/master/pkg/config/config.go#L104.
> 
> —
> Reply to this email directly or view it on GitHub.
>