2016-11-01 23:32:21 -04:00
|
|
|
package secret
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"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-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
|
|
|
})
|
|
|
|
}
|