@@ -28,6 +28,7 @@ func TestGenericTypeMeta(t *testing.T) {
2828 type TypeMeta struct {
2929 Kind string `json:"kind,omitempty"`
3030 Namespace string `json:"namespace,omitempty"`
31+ Tenant string `json:"tenant,omitempty"`
3132 Name string `json:"name,omitempty"`
3233 GenerateName string `json:"generateName,omitempty"`
3334 UID string `json:"uid,omitempty"`
@@ -44,6 +45,7 @@ func TestGenericTypeMeta(t *testing.T) {
4445 j := Object {
4546 TypeMeta {
4647 Namespace : "bar" ,
48+ Tenant : "hah" ,
4749 Name : "foo" ,
4850 GenerateName : "prefix" ,
4951 UID : "uid" ,
@@ -62,6 +64,9 @@ func TestGenericTypeMeta(t *testing.T) {
6264 if e , a := "bar" , accessor .Namespace (); e != a {
6365 t .Errorf ("expected %v, got %v" , e , a )
6466 }
67+ if e , a := "hah" , accessor .Tenant (); e != a {
68+ t .Errorf ("expected %v, got %v" , e , a )
69+ }
6570 if e , a := "foo" , accessor .Name (); e != a {
6671 t .Errorf ("expected %v, got %v" , e , a )
6772 }
@@ -96,6 +101,7 @@ func TestGenericTypeMeta(t *testing.T) {
96101 }
97102
98103 accessor .SetNamespace ("baz" )
104+ accessor .SetTenant ("uau" )
99105 accessor .SetName ("bar" )
100106 accessor .SetGenerateName ("generate" )
101107 accessor .SetUID ("other" )
@@ -108,6 +114,9 @@ func TestGenericTypeMeta(t *testing.T) {
108114 if e , a := "baz" , j .Namespace ; e != a {
109115 t .Errorf ("expected %v, got %v" , e , a )
110116 }
117+ if e , a := "uau" , j .Tenant ; e != a {
118+ t .Errorf ("expected %v, got %v" , e , a )
119+ }
111120 if e , a := "bar" , j .Name ; e != a {
112121 t .Errorf ("expected %v, got %v" , e , a )
113122 }
@@ -143,6 +152,7 @@ func TestGenericTypeMeta(t *testing.T) {
143152type InternalTypeMeta struct {
144153 Kind string `json:"kind,omitempty"`
145154 Namespace string `json:"namespace,omitempty"`
155+ Tenant string `json:"tenant,omitempty"`
146156 Name string `json:"name,omitempty"`
147157 GenerateName string `json:"generateName,omitempty"`
148158 UID string `json:"uid,omitempty"`
@@ -163,6 +173,7 @@ func TestGenericTypeMetaAccessor(t *testing.T) {
163173 j := & InternalObject {
164174 InternalTypeMeta {
165175 Namespace : "bar" ,
176+ Tenant : "hah" ,
166177 Name : "foo" ,
167178 GenerateName : "prefix" ,
168179 UID : "uid" ,
@@ -182,6 +193,13 @@ func TestGenericTypeMetaAccessor(t *testing.T) {
182193 if e , a := "bar" , namespace ; e != a {
183194 t .Errorf ("expected %v, got %v" , e , a )
184195 }
196+ tenant , err := accessor .Tenant (j )
197+ if err != nil {
198+ t .Errorf ("unexpected error: %v" , err )
199+ }
200+ if e , a := "hah" , tenant ; e != a {
201+ t .Errorf ("expected %v, got %v" , e , a )
202+ }
185203 name , err := accessor .Name (j )
186204 if err != nil {
187205 t .Errorf ("unexpected error: %v" , err )
@@ -249,6 +267,9 @@ func TestGenericTypeMetaAccessor(t *testing.T) {
249267 if err := accessor .SetNamespace (j , "baz" ); err != nil {
250268 t .Errorf ("unexpected error: %v" , err )
251269 }
270+ if err := accessor .SetTenant (j , "uau" ); err != nil {
271+ t .Errorf ("unexpected error: %v" , err )
272+ }
252273 if err := accessor .SetName (j , "bar" ); err != nil {
253274 t .Errorf ("unexpected error: %v" , err )
254275 }
@@ -282,6 +303,9 @@ func TestGenericTypeMetaAccessor(t *testing.T) {
282303 if e , a := "baz" , j .TypeMeta .Namespace ; e != a {
283304 t .Errorf ("expected %v, got %v" , e , a )
284305 }
306+ if e , a := "uau" , j .TypeMeta .Tenant ; e != a {
307+ t .Errorf ("expected %v, got %v" , e , a )
308+ }
285309 if e , a := "bar" , j .TypeMeta .Name ; e != a {
286310 t .Errorf ("expected %v, got %v" , e , a )
287311 }
@@ -318,6 +342,7 @@ func TestGenericObjectMeta(t *testing.T) {
318342 }
319343 type ObjectMeta struct {
320344 Namespace string `json:"namespace,omitempty"`
345+ Tenant string `json:"tenant,omitempty"`
321346 Name string `json:"name,omitempty"`
322347 GenerateName string `json:"generateName,omitempty"`
323348 UID string `json:"uid,omitempty"`
@@ -338,6 +363,7 @@ func TestGenericObjectMeta(t *testing.T) {
338363 },
339364 ObjectMeta {
340365 Namespace : "bar" ,
366+ Tenant : "hah" ,
341367 Name : "foo" ,
342368 GenerateName : "prefix" ,
343369 UID : "uid" ,
@@ -354,6 +380,9 @@ func TestGenericObjectMeta(t *testing.T) {
354380 if e , a := "bar" , accessor .Namespace (); e != a {
355381 t .Errorf ("expected %v, got %v" , e , a )
356382 }
383+ if e , a := "hah" , accessor .Tenant (); e != a {
384+ t .Errorf ("expected %v, got %v" , e , a )
385+ }
357386 if e , a := "foo" , accessor .Name (); e != a {
358387 t .Errorf ("expected %v, got %v" , e , a )
359388 }
@@ -383,6 +412,7 @@ func TestGenericObjectMeta(t *testing.T) {
383412 }
384413
385414 accessor .SetNamespace ("baz" )
415+ accessor .SetTenant ("uau" )
386416 accessor .SetName ("bar" )
387417 accessor .SetGenerateName ("generate" )
388418 accessor .SetUID ("other" )
@@ -397,6 +427,9 @@ func TestGenericObjectMeta(t *testing.T) {
397427 if e , a := "baz" , j .Namespace ; e != a {
398428 t .Errorf ("expected %v, got %v" , e , a )
399429 }
430+ if e , a := "uau" , j .Tenant ; e != a {
431+ t .Errorf ("expected %v, got %v" , e , a )
432+ }
400433 if e , a := "bar" , j .Name ; e != a {
401434 t .Errorf ("expected %v, got %v" , e , a )
402435 }
0 commit comments