review updates

- 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>
Upstream-commit: ab6c38e014
Component: cli
This commit is contained in:
Evan Hazlett
2016-11-03 14:09:13 -04:00
parent 719ce57b9e
commit 8788cdab0b
2 changed files with 3 additions and 3 deletions

View File

@ -14,8 +14,8 @@ import (
func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
query := url.Values{}
if options.Filter.Len() > 0 {
filterJSON, err := filters.ToParam(options.Filter)
if options.Filters.Len() > 0 {
filterJSON, err := filters.ToParam(options.Filters)
if err != nil {
return nil, err
}

View File

@ -45,7 +45,7 @@ func TestSecretList(t *testing.T) {
},
{
options: types.SecretListOptions{
Filter: filters,
Filters: filters,
},
expectedQueryParams: map[string]string{
"filters": `{"label":{"label1":true,"label2":true}}`,