diff --git a/daemon/cluster/secrets.go b/daemon/cluster/secrets.go index 27114152f4..2b9eb5da1d 100644 --- a/daemon/cluster/secrets.go +++ b/daemon/cluster/secrets.go @@ -9,6 +9,13 @@ import ( // GetSecret returns a secret from a managed swarm cluster func (c *Cluster) GetSecret(id string) (types.Secret, error) { + c.RLock() + defer c.RUnlock() + + if !c.isActiveManager() { + return types.Secret{}, c.errNoManager() + } + ctx, cancel := c.getRequestContext() defer cancel() diff --git a/docs/reference/api/docker_remote_api_v1.25.md b/docs/reference/api/docker_remote_api_v1.25.md index ee796f2635..e247be8f9e 100644 --- a/docs/reference/api/docker_remote_api_v1.25.md +++ b/docs/reference/api/docker_remote_api_v1.25.md @@ -6060,9 +6060,9 @@ Create a secret ### Inspect a secret -`GET /secrets/(secret id)` +`GET /secrets/(id)` -Get details on a secret +Get details on the secret `id` **Example request**: @@ -6088,6 +6088,7 @@ Get details on a secret - **200** – no error - **404** – unknown secret +- **406** – node is not part of a swarm - **500** – server error ### Remove a secret