dockershim: fix docker filter, Hostname, and the apiversion
This commit is contained in:
		| @@ -103,7 +103,6 @@ func (ds *dockerService) CreateContainer(podSandboxID string, config *runtimeApi | ||||
| 		Name: makeContainerName(sandboxConfig, config), | ||||
| 		Config: &dockercontainer.Config{ | ||||
| 			// TODO: set User. | ||||
| 			Hostname:   sandboxConfig.GetHostname(), | ||||
| 			Entrypoint: dockerstrslice.StrSlice(config.GetCommand()), | ||||
| 			Cmd:        dockerstrslice.StrSlice(config.GetArgs()), | ||||
| 			Env:        generateEnvList(config.GetEnvs()), | ||||
|   | ||||
| @@ -80,10 +80,13 @@ func (ds *dockerService) Version(apiVersion string) (*runtimeApi.VersionResponse | ||||
| 	} | ||||
| 	runtimeAPIVersion := kubeAPIVersion | ||||
| 	name := dockerRuntimeName | ||||
| 	// Docker API version (e.g., 1.23) is not semver compatible. Add a ".0" | ||||
| 	// suffix to remedy this. | ||||
| 	apiVersion := fmt.Sprintf("%s.0", v.APIVersion) | ||||
| 	return &runtimeApi.VersionResponse{ | ||||
| 		Version:           &runtimeAPIVersion, | ||||
| 		RuntimeName:       &name, | ||||
| 		RuntimeVersion:    &v.Version, | ||||
| 		RuntimeApiVersion: &v.APIVersion, | ||||
| 		RuntimeApiVersion: &apiVersion, | ||||
| 	}, nil | ||||
| } | ||||
|   | ||||
| @@ -161,15 +161,15 @@ func getNetworkNamespace(c *dockertypes.ContainerJSON) string { | ||||
| // dockerFilter wraps around dockerfilters.Args and provides methods to modify | ||||
| // the filter easily. | ||||
| type dockerFilter struct { | ||||
| 	f *dockerfilters.Args | ||||
| 	args *dockerfilters.Args | ||||
| } | ||||
|  | ||||
| func newDockerFilter(args *dockerfilters.Args) *dockerFilter { | ||||
| 	return &dockerFilter{f: args} | ||||
| 	return &dockerFilter{args: args} | ||||
| } | ||||
|  | ||||
| func (f *dockerFilter) Add(key, value string) { | ||||
| 	f.Add(key, value) | ||||
| 	f.args.Add(key, value) | ||||
| } | ||||
|  | ||||
| func (f *dockerFilter) AddLabel(key, value string) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu-Ju Hong
					Yu-Ju Hong