Forráskód Böngészése

updates for review comments

- runtimeUrl -> type_url
- runtimes -> runtime

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Evan Hazlett 8 éve
szülő
commit
8c2c69d31e

+ 1 - 1
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

+ 2 - 2
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 {

+ 1 - 1
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
 }
 

+ 2 - 2
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)

+ 2 - 2
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 {

+ 6 - 6
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()