updates for review comments

- runtimeUrl -> type_url
- runtimes -> runtime

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2017-03-24 15:19:59 -04:00
parent f71bdc67a2
commit 8c2c69d31e
6 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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
}

View File

@ -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)

View File

@ -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 {

View File

@ -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()