agent: intention update/delete responess match ACL/KV behavior

pull/4275/head
Mitchell Hashimoto 2018-06-13 11:54:27 +01:00 committed by Jack Pearkes
parent 3c17144fb5
commit 181fbcc9b9
2 changed files with 7 additions and 4 deletions

View File

@ -248,7 +248,8 @@ func (s *HTTPServer) IntentionSpecificUpdate(id string, resp http.ResponseWriter
return nil, err
}
return nil, nil
// Update uses the same create response
return intentionCreateResponse{reply}, nil
}
@ -268,7 +269,7 @@ func (s *HTTPServer) IntentionSpecificDelete(id string, resp http.ResponseWriter
return nil, err
}
return nil, nil
return true, nil
}
// intentionCreateResponse is the response structure for creating an intention.

View File

@ -380,7 +380,9 @@ func TestIntentionsSpecificUpdate_good(t *testing.T) {
resp := httptest.NewRecorder()
obj, err := a.srv.IntentionSpecific(resp, req)
assert.Nil(err)
assert.Nil(obj)
value := obj.(intentionCreateResponse)
assert.Equal(reply, value.ID)
// Read the value
{
@ -436,7 +438,7 @@ func TestIntentionsSpecificDelete_good(t *testing.T) {
resp := httptest.NewRecorder()
obj, err := a.srv.IntentionSpecific(resp, req)
assert.Nil(err)
assert.Nil(obj)
assert.Equal(true, obj)
// Verify the intention is gone
{