From 8c2c69d31ec0ce4a9b125ca3cbf7b04ee81ce579 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Fri, 24 Mar 2017 15:19:59 -0400 Subject: [PATCH] updates for review comments - runtimeUrl -> type_url - runtimes -> runtime Signed-off-by: Evan Hazlett --- cli/command/service/list.go | 2 +- cli/command/service/ps.go | 4 ++-- cli/command/stack/common.go | 2 +- daemon/cluster/convert/service.go | 4 ++-- daemon/cluster/executor/container/executor.go | 4 ++-- daemon/cluster/services.go | 12 ++++++------ 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cli/command/service/list.go b/cli/command/service/list.go index 67c120da58..1754297316 100644 --- a/cli/command/service/list.go +++ b/cli/command/service/list.go @@ -46,7 +46,7 @@ func runList(dockerCli *command.DockerCli, opts listOptions) error { client := dockerCli.Client() serviceFilters := opts.filter.Value() - serviceFilters.Add("runtimes", string(swarm.RuntimeContainer)) + serviceFilters.Add("runtime", string(swarm.RuntimeContainer)) services, err := client.ServiceList(ctx, types.ServiceListOptions{Filters: serviceFilters}) if err != nil { return err diff --git a/cli/command/service/ps.go b/cli/command/service/ps.go index f9720bd3e6..2c633c66d0 100644 --- a/cli/command/service/ps.go +++ b/cli/command/service/ps.go @@ -61,9 +61,9 @@ func runPS(dockerCli *command.DockerCli, opts psOptions) error { for _, service := range opts.services { // default to container runtime serviceIDFilter.Add("id", service) - serviceIDFilter.Add("runtimes", string(swarmtypes.RuntimeContainer)) + serviceIDFilter.Add("runtime", string(swarmtypes.RuntimeContainer)) serviceNameFilter.Add("name", service) - serviceNameFilter.Add("runtimes", string(swarmtypes.RuntimeContainer)) + serviceNameFilter.Add("runtime", string(swarmtypes.RuntimeContainer)) } serviceByIDList, err := client.ServiceList(ctx, types.ServiceListOptions{Filters: serviceIDFilter}) if err != nil { diff --git a/cli/command/stack/common.go b/cli/command/stack/common.go index 90bc19682e..e69e3fa908 100644 --- a/cli/command/stack/common.go +++ b/cli/command/stack/common.go @@ -19,7 +19,7 @@ func getStackFilter(namespace string) filters.Args { func getServiceFilter(namespace string) filters.Args { filter := getStackFilter(namespace) - filter.Add("runtimes", string(swarm.RuntimeContainer)) + filter.Add("runtime", string(swarm.RuntimeContainer)) return filter } diff --git a/daemon/cluster/convert/service.go b/daemon/cluster/convert/service.go index fdddf98335..e6d0ed6aad 100644 --- a/daemon/cluster/convert/service.go +++ b/daemon/cluster/convert/service.go @@ -85,8 +85,8 @@ func serviceSpecFromGRPC(spec *swarmapi.ServiceSpec) (*types.ServiceSpec, error) taskTemplate.ContainerSpec = containerSpecFromGRPC(containerConfig) taskTemplate.Runtime = types.RuntimeContainer case *swarmapi.TaskSpec_Generic: - switch t.Generic.Payload.TypeUrl { - case string(types.RuntimeURLPlugin): + switch t.Generic.Kind { + case string(types.RuntimePlugin): taskTemplate.Runtime = types.RuntimePlugin default: return nil, fmt.Errorf("unknown task runtime type: %s", t.Generic.Payload.TypeUrl) diff --git a/daemon/cluster/executor/container/executor.go b/daemon/cluster/executor/container/executor.go index f889b994af..b18f3dd590 100644 --- a/daemon/cluster/executor/container/executor.go +++ b/daemon/cluster/executor/container/executor.go @@ -165,8 +165,8 @@ func (e *executor) Controller(t *api.Task) (exec.Controller, error) { switch r := t.Spec.GetRuntime().(type) { case *api.TaskSpec_Generic: logrus.WithFields(logrus.Fields{ - "kind": r.Generic.Kind, - "runtimeUrl": r.Generic.Payload.TypeUrl, + "kind": r.Generic.Kind, + "type_url": r.Generic.Payload.TypeUrl, }).Debug("custom runtime requested") runtimeKind, err := naming.Runtime(t.Spec) if err != nil { diff --git a/daemon/cluster/services.go b/daemon/cluster/services.go index a315580350..5afc08cf91 100644 --- a/daemon/cluster/services.go +++ b/daemon/cluster/services.go @@ -40,11 +40,11 @@ func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Serv // be good to have accepted file check in the same file as // the filter processing (in the for loop below). accepted := map[string]bool{ - "name": true, - "id": true, - "label": true, - "mode": true, - "runtimes": true, + "name": true, + "id": true, + "label": true, + "mode": true, + "runtime": true, } if err := options.Filters.Validate(accepted); err != nil { return nil, err @@ -54,7 +54,7 @@ func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Serv NamePrefixes: options.Filters.Get("name"), IDPrefixes: options.Filters.Get("id"), Labels: runconfigopts.ConvertKVStringsToMap(options.Filters.Get("label")), - Runtimes: options.Filters.Get("runtimes"), + Runtimes: options.Filters.Get("runtime"), } ctx, cancel := c.getRequestContext()