Skip to content

Commit

Permalink
Fix tests to support ObjectMeta omitempty semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhita committed Aug 21, 2018
1 parent f69544e commit dabd56f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"name": "svc1",
"namespace": "edit-test",
"resourceVersion": "",
"selfLink": "/api/v1/namespaces/edit-test/services/svc1",
"uid": "4149f70e-e9dc-11e6-8c3b-acbc32c1ca87"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"name": "svc2",
"namespace": "edit-test",
"resourceVersion": "",
"selfLink": "/api/v1/namespaces/edit-test/services/svc2",
"uid": "3e9b10db-e9dc-11e6-8c3b-acbc32c1ca87"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"metadata": {
"labels": {
"label2": "value2"
},
"namespace": ""
}
},
"unknownClientField": {
"clientdata": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"metadata": {
"labels": {
"label2": "value2"
},
"namespace": ""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func TestDryRunUpdateReturnsObject(t *testing.T) {
if err != nil {
t.Fatalf("Failed to dry-run update: %v", err)
}
out = UnstructuredOrDie(`{"field": "value", "kind": "Pod", "metadata": {"resourceVersion": "2", "selfLink": ""}}`)
out = UnstructuredOrDie(`{"field": "value", "kind": "Pod", "metadata": {"resourceVersion": "2"}}`)
if !reflect.DeepEqual(obj, out) {
t.Fatalf("Returned object %#v different from expected %#v", obj, out)
}
Expand Down Expand Up @@ -268,7 +268,7 @@ func TestDryRunDeleteReturnsObject(t *testing.T) {
}

out = UnstructuredOrDie(`{}`)
expected := UnstructuredOrDie(`{"kind": "Pod", "metadata": {"resourceVersion": "2", "selfLink": ""}}`)
expected := UnstructuredOrDie(`{"kind": "Pod", "metadata": {"resourceVersion": "2"}}`)
err = s.Delete(context.Background(), "key", out, nil, true)
if err != nil {
t.Fatalf("Failed to delete with valid precondition: %v", err)
Expand Down

0 comments on commit dabd56f

Please sign in to comment.