mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
b82be871ab
Signed-off-by: yupeng <yu.peng36@zte.com.cn>
(cherry picked from commit aff5dacec1
)
Signed-off-by: Victor Vieux <victorvieux@gmail.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(ctx context.Context, client client.APIClient, names []string) ([]swarm.Secret, error) {
|
|
args := filters.NewArgs()
|
|
for _, n := range names {
|
|
args.Add("names", n)
|
|
}
|
|
|
|
return client.SecretList(ctx, types.SecretListOptions{
|
|
Filters: args,
|
|
})
|
|
}
|