Browse Source

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 8 năm trước cách đây
mục cha
commit
375e970991

+ 1 - 0
api/server/router/swarm/cluster_routes.go

@@ -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
 }

+ 5 - 1
docs/api/version-history.md

@@ -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
 

+ 1 - 1
integration-cli/daemon_swarm.go

@@ -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 {