let kubectl label use PATCH instead of PUT

This commit is contained in:
Chao Xu
2015-10-14 11:07:47 -07:00
parent c9d6037c81
commit b5a3ab67da
2 changed files with 29 additions and 9 deletions

View File

@@ -339,7 +339,7 @@ func TestLabelForResourceFromFile(t *testing.T) {
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
return nil, nil
}
case "PUT":
case "PATCH":
switch req.URL.Path {
case "/namespaces/test/pods/cassandra":
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods.Items[0])}, nil
@@ -386,7 +386,7 @@ func TestLabelMultipleObjects(t *testing.T) {
t.Fatalf("unexpected request: %#v\n%#v", req.URL, req)
return nil, nil
}
case "PUT":
case "PATCH":
switch req.URL.Path {
case "/namespaces/test/pods/foo":
return &http.Response{StatusCode: 200, Body: objBody(codec, &pods.Items[0])}, nil