correct the http return code of secret remove
Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit 21768933fb
)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
30e5e0a781
commit
375e970991
3 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -72,7 +72,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
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue