dockertools: fix Windows implementation.

Fixes #39005
Fixes #39714
This commit is contained in:
Paulo Pires 2017-01-11 10:37:53 +00:00
parent 3888aca8ab
commit dacc363605
No known key found for this signature in database
GPG Key ID: F3F6ED5C522EAA71
4 changed files with 11 additions and 8 deletions

View File

@ -709,7 +709,7 @@ func (dm *DockerManager) runContainer(
SecurityOpt: fmtSecurityOpts,
}
updateHostConfig(hc)
updateHostConfig(hc, opts)
// Set sysctls if requested
if container.Name == PodInfraContainerName {

View File

@ -23,10 +23,11 @@ import (
dockercontainer "github.com/docker/engine-api/types/container"
"k8s.io/kubernetes/pkg/api/v1"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
)
// These two functions are OS specific (for now at least)
func updateHostConfig(config *dockercontainer.HostConfig) {
func updateHostConfig(hc *dockercontainer.HostConfig, opts *kubecontainer.RunContainerOptions) {
// no-op, there is a windows implementation that is different.
}

View File

@ -19,14 +19,15 @@ limitations under the License.
package dockertools
import (
"k8s.io/kubernetes/pkg/api/v1"
dockertypes "github.com/docker/engine-api/types"
dockercontainer "github.com/docker/engine-api/types/container"
"k8s.io/kubernetes/pkg/api/v1"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
)
// These two functions are OS specific (for now at least)
func updateHostConfig(config *dockercontainer.HostConfig) {
func updateHostConfig(hc *dockercontainer.HostConfig, opts *kubecontainer.RunContainerOptions) {
}
func DefaultMemorySwap() int64 {

View File

@ -21,14 +21,15 @@ package dockertools
import (
"os"
"k8s.io/kubernetes/pkg/api/v1"
dockertypes "github.com/docker/engine-api/types"
dockercontainer "github.com/docker/engine-api/types/container"
"k8s.io/kubernetes/pkg/api/v1"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
)
// These two functions are OS specific (for now at least)
func updateHostConfig(config *dockercontainer.HostConfig) {
func updateHostConfig(hc *dockercontainer.HostConfig, opts *kubecontainer.RunContainerOptions) {
// There is no /etc/resolv.conf in Windows, DNS and DNSSearch options would have to be passed to Docker runtime instead
hc.DNS = opts.DNS
hc.DNSSearch = opts.DNSSearch