utils.go 489 B

1234567891011121314151617181920
  1. package secret
  2. import (
  3. "github.com/docker/docker/api/types"
  4. "github.com/docker/docker/api/types/filters"
  5. "github.com/docker/docker/api/types/swarm"
  6. "github.com/docker/docker/client"
  7. "golang.org/x/net/context"
  8. )
  9. func getSecretsByName(ctx context.Context, client client.APIClient, names []string) ([]swarm.Secret, error) {
  10. args := filters.NewArgs()
  11. for _, n := range names {
  12. args.Add("names", n)
  13. }
  14. return client.SecretList(ctx, types.SecretListOptions{
  15. Filters: args,
  16. })
  17. }