Signed-off-by: allencloud <allen.sun@daocloud.io>
| ... | ... |
@@ -9,6 +9,13 @@ import ( |
| 9 | 9 |
|
| 10 | 10 |
// GetSecret returns a secret from a managed swarm cluster |
| 11 | 11 |
func (c *Cluster) GetSecret(id string) (types.Secret, error) {
|
| 12 |
+ c.RLock() |
|
| 13 |
+ defer c.RUnlock() |
|
| 14 |
+ |
|
| 15 |
+ if !c.isActiveManager() {
|
|
| 16 |
+ return types.Secret{}, c.errNoManager()
|
|
| 17 |
+ } |
|
| 18 |
+ |
|
| 12 | 19 |
ctx, cancel := c.getRequestContext() |
| 13 | 20 |
defer cancel() |
| 14 | 21 |
|
| ... | ... |
@@ -6060,9 +6060,9 @@ Create a secret |
| 6060 | 6060 |
|
| 6061 | 6061 |
### Inspect a secret |
| 6062 | 6062 |
|
| 6063 |
-`GET /secrets/(secret id)` |
|
| 6063 |
+`GET /secrets/(id)` |
|
| 6064 | 6064 |
|
| 6065 |
-Get details on a secret |
|
| 6065 |
+Get details on the secret `id` |
|
| 6066 | 6066 |
|
| 6067 | 6067 |
**Example request**: |
| 6068 | 6068 |
|
| ... | ... |
@@ -6088,6 +6088,7 @@ Get details on a secret |
| 6088 | 6088 |
|
| 6089 | 6089 |
- **200** – no error |
| 6090 | 6090 |
- **404** – unknown secret |
| 6091 |
+- **406** – node is not part of a swarm |
|
| 6091 | 6092 |
- **500** – server error |
| 6092 | 6093 |
|
| 6093 | 6094 |
### Remove a secret |