mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
b2e4c7f3b5
- use Filters instead of Filter for secret list - UID, GID -> string - getSecrets -> getSecretsByName - updated test case for secrets with better source - use golang.org/x/context instead of context - for grpc conversion allocate with make - check for nil with task.Spec.GetContainer() Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
21 lines
473 B
Go
21 lines
473 B
Go
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"
|
|
)
|
|
|
|
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,
|
|
})
|
|
}
|