correct the http return code of secret remove

Signed-off-by: erxian <evelynhsu21@gmail.com>
This commit is contained in:
erxian 2016-11-29 13:37:16 +08:00
parent 1ef10c83c7
commit 21768933fb
3 changed files with 7 additions and 2 deletions

View File

@ -383,6 +383,7 @@ func (sr *swarmRouter) removeSecret(ctx context.Context, w http.ResponseWriter,
if err := sr.backend.RemoveSecret(vars["id"]); err != nil {
return err
}
w.WriteHeader(http.StatusNoContent)
return nil
}

View File

@ -76,7 +76,11 @@ keywords: "API, Docker, rcli, REST, documentation"
* `DELETE /plugins/(plugin name)` delete a plugin.
* `POST /node/(id or name)/update` now accepts both `id` or `name` to identify the node to update.
* `GET /images/json` now support a `reference` filter.
* `GET /secrets` returns information on the secrets.
* `POST /secrets/create` creates a secret.
* `DELETE /secrets/{id}` removes the secret `id`.
* `GET /secrets/{id}` returns information on the secret `id`.
* `POST /secrets/{id}/update` updates the secret `id`.
## v1.24 API changes

View File

@ -317,7 +317,7 @@ func (d *SwarmDaemon) getSecret(c *check.C, id string) *swarm.Secret {
func (d *SwarmDaemon) deleteSecret(c *check.C, id string) {
status, out, err := d.SockRequest("DELETE", "/secrets/"+id, nil)
c.Assert(err, checker.IsNil, check.Commentf(string(out)))
c.Assert(status, checker.Equals, http.StatusOK, check.Commentf("output: %q", string(out)))
c.Assert(status, checker.Equals, http.StatusNoContent, check.Commentf("output: %q", string(out)))
}
func (d *SwarmDaemon) getSwarm(c *check.C) swarm.Swarm {