Add namespace error checking if a resource is not found.

This commit is contained in:
Brendan Burns
2016-08-29 20:57:59 -07:00
parent 4387dcbdd5
commit 23c7c2e3e7
3 changed files with 19 additions and 0 deletions

View File

@@ -283,6 +283,8 @@ func TestApplyNonExistObject(t *testing.T) {
NegotiatedSerializer: ns,
Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {
switch p, m := req.URL.Path, req.Method; {
case p == "/api/v1/namespaces/test" && m == "GET":
return &http.Response{StatusCode: 404, Header: defaultHeader(), Body: ioutil.NopCloser(bytes.NewReader(nil))}, nil
case p == pathNameRC && m == "GET":
return &http.Response{StatusCode: 404, Header: defaultHeader(), Body: ioutil.NopCloser(bytes.NewReader(nil))}, nil
case p == pathRC && m == "POST":