mirror of https://github.com/hashicorp/consul
agent: intention update/delete responess match ACL/KV behavior
parent
3c17144fb5
commit
181fbcc9b9
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue