Browse code

correct the http return code of secret remove

Signed-off-by: erxian <evelynhsu21@gmail.com>
(cherry picked from commit 21768933fbf61d1481e303ee7a3a5ecc57fc3838)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

erxian authored on 2016/11/29 14:37:16
Showing 3 changed files
... ...
@@ -383,6 +383,7 @@ func (sr *swarmRouter) removeSecret(ctx context.Context, w http.ResponseWriter,
383 383
 	if err := sr.backend.RemoveSecret(vars["id"]); err != nil {
384 384
 		return err
385 385
 	}
386
+	w.WriteHeader(http.StatusNoContent)
386 387
 
387 388
 	return nil
388 389
 }
... ...
@@ -72,7 +72,11 @@ keywords: "API, Docker, rcli, REST, documentation"
72 72
 * `DELETE /plugins/(plugin name)` delete a plugin.
73 73
 * `POST /node/(id or name)/update` now accepts both `id` or `name` to identify the node to update.
74 74
 * `GET /images/json` now support a `reference` filter.
75
-
75
+* `GET /secrets` returns information on the secrets.
76
+* `POST /secrets/create` creates a secret.
77
+* `DELETE /secrets/{id}` removes the secret `id`.
78
+* `GET /secrets/{id}` returns information on the secret `id`.
79
+* `POST /secrets/{id}/update` updates the secret `id`.
76 80
 
77 81
 ## v1.24 API changes
78 82
 
... ...
@@ -317,7 +317,7 @@ func (d *SwarmDaemon) getSecret(c *check.C, id string) *swarm.Secret {
317 317
 func (d *SwarmDaemon) deleteSecret(c *check.C, id string) {
318 318
 	status, out, err := d.SockRequest("DELETE", "/secrets/"+id, nil)
319 319
 	c.Assert(err, checker.IsNil, check.Commentf(string(out)))
320
-	c.Assert(status, checker.Equals, http.StatusOK, check.Commentf("output: %q", string(out)))
320
+	c.Assert(status, checker.Equals, http.StatusNoContent, check.Commentf("output: %q", string(out)))
321 321
 }
322 322
 
323 323
 func (d *SwarmDaemon) getSwarm(c *check.C) swarm.Swarm {