2016-11-01 23:32:21 -04:00
|
|
|
package secret
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/api/types"
|
|
|
|
"github.com/docker/docker/api/types/filters"
|
|
|
|
"github.com/docker/docker/api/types/swarm"
|
|
|
|
"github.com/docker/docker/client"
|
2016-11-09 19:59:01 -05:00
|
|
|
"golang.org/x/net/context"
|
2016-11-01 23:32:21 -04:00
|
|
|
)
|
|
|
|
|
2016-11-03 14:09:13 -04:00
|
|
|
func getSecretsByName(client client.APIClient, ctx context.Context, names []string) ([]swarm.Secret, error) {
|
2016-11-01 23:32:21 -04:00
|
|
|
args := filters.NewArgs()
|
|
|
|
for _, n := range names {
|
|
|
|
args.Add("names", n)
|
|
|
|
}
|
|
|
|
|
|
|
|
return client.SecretList(ctx, types.SecretListOptions{
|
2016-11-03 14:09:13 -04:00
|
|
|
Filters: args,
|
2016-11-01 23:32:21 -04:00
|
|
|
})
|
|
|
|
}
|