Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
This commit is contained in:
@@ -45,18 +45,18 @@ func TestValidNamespace(t *testing.T) {
|
||||
ctx := api.NewDefaultContext()
|
||||
namespace, _ := api.NamespaceFrom(ctx)
|
||||
resource := api.ReplicationController{}
|
||||
if !api.ValidNamespace(ctx, &resource.JSONBase) {
|
||||
if !api.ValidNamespace(ctx, &resource.TypeMeta) {
|
||||
t.Errorf("expected success")
|
||||
}
|
||||
if namespace != resource.Namespace {
|
||||
t.Errorf("expected resource to have the default namespace assigned during validation")
|
||||
}
|
||||
resource = api.ReplicationController{JSONBase: api.JSONBase{Namespace: "other"}}
|
||||
if api.ValidNamespace(ctx, &resource.JSONBase) {
|
||||
resource = api.ReplicationController{TypeMeta: api.TypeMeta{Namespace: "other"}}
|
||||
if api.ValidNamespace(ctx, &resource.TypeMeta) {
|
||||
t.Errorf("Expected error that resource and context errors do not match because resource has different namespace")
|
||||
}
|
||||
ctx = api.NewContext()
|
||||
if api.ValidNamespace(ctx, &resource.JSONBase) {
|
||||
if api.ValidNamespace(ctx, &resource.TypeMeta) {
|
||||
t.Errorf("Expected error that resource and context errors do not match since context has no namespace")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user