pkg/api: move HasObjectMetaSystemFieldValues into apimachinery

This commit is contained in:
Dr. Stefan Schimanski
2017-01-29 22:15:52 +01:00
parent 96cfe7b938
commit d6adb51e6c
5 changed files with 11 additions and 32 deletions

View File

@@ -49,11 +49,11 @@ func TestFillObjectMetaSystemFields(t *testing.T) {
func TestHasObjectMetaSystemFieldValues(t *testing.T) {
ctx := genericapirequest.NewDefaultContext()
resource := metav1.ObjectMeta{}
if api.HasObjectMetaSystemFieldValues(&resource) {
if metav1.HasObjectMetaSystemFieldValues(&resource) {
t.Errorf("the resource does not have all fields yet populated, but incorrectly reports it does")
}
FillObjectMetaSystemFields(ctx, &resource)
if !api.HasObjectMetaSystemFieldValues(&resource) {
if !metav1.HasObjectMetaSystemFieldValues(&resource) {
t.Errorf("the resource does have all fields populated, but incorrectly reports it does not")
}
}

View File

@@ -328,7 +328,7 @@ func (t *Tester) testCreateHasMetadata(valid runtime.Object) {
t.Fatalf("Unexpected object from result: %#v", obj)
}
defer t.delete(t.TestContext(), obj)
if !api.HasObjectMetaSystemFieldValues(objectMeta) {
if !metav1.HasObjectMetaSystemFieldValues(objectMeta) {
t.Errorf("storage did not populate object meta field values")
}
}