Rename JSONBase -> TypeMeta in preparation for v1beta3

Will make subsequent refactor much easier
This commit is contained in:
Clayton Coleman
2014-10-07 11:12:16 -04:00
parent e294cef9d4
commit d3e51a0f24
69 changed files with 464 additions and 464 deletions

View File

@@ -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")
}
}