Merge pull request #28350 from allencloud/add-swarm-judging-in-secret-API

judge manager before getting secret
This commit is contained in:
Vincent Demeester 2016-11-13 22:19:07 +01:00 committed by GitHub
commit 0f20d6f5ab
2 changed files with 10 additions and 2 deletions

View file

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

View file

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