Update code for latest k8s

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2018-02-12 12:13:07 -08:00
parent 8f5e37a83c
commit 5f7ac28059
792 changed files with 25023 additions and 19841 deletions

View file

@ -34,7 +34,7 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"golang.org/x/sys/unix"
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
)
const (
@ -600,7 +600,7 @@ func hostNetwork(containerConfig *pb.ContainerConfig) bool {
return false
}
return securityContext.GetNamespaceOptions().HostNetwork
return securityContext.GetNamespaceOptions().GetNetwork() == pb.NamespaceMode_NODE
}
// ensureSaneLogPath is a hack to fix https://issues.k8s.io/44043 which causes
@ -997,7 +997,7 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
return nil, err
}
if containerConfig.GetLinux().GetSecurityContext().GetNamespaceOptions().GetHostPid() {
if containerConfig.GetLinux().GetSecurityContext().GetNamespaceOptions().GetPid() == pb.NamespaceMode_NODE {
// kubernetes PodSpec specify to use Host PID namespace
specgen.RemoveLinuxNamespace(string(rspec.PIDNamespace))
} else if s.config.EnableSharedPIDNamespace {