mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
8e701f0bd7
Signed-off-by: Victor Vieux <vieux@docker.com>
20 lines
489 B
Go
20 lines
489 B
Go
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"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
func getSecretsByName(client client.APIClient, ctx context.Context, names []string) ([]swarm.Secret, error) {
|
|
args := filters.NewArgs()
|
|
for _, n := range names {
|
|
args.Add("names", n)
|
|
}
|
|
|
|
return client.SecretList(ctx, types.SecretListOptions{
|
|
Filters: args,
|
|
})
|
|
}
|