Update code for latest k8s
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
8f5e37a83c
commit
5f7ac28059
792 changed files with 25023 additions and 19841 deletions
|
@ -23,7 +23,7 @@ import (
|
|||
"github.com/opencontainers/selinux/go-selinux/label"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
|
||||
"k8s.io/kubernetes/pkg/kubelet/network/hostport"
|
||||
)
|
||||
|
||||
|
@ -340,7 +340,10 @@ func (c *ContainerServer) LoadSandbox(id string) error {
|
|||
|
||||
privileged := isTrue(m.Annotations[annotations.PrivilegedRuntime])
|
||||
trusted := isTrue(m.Annotations[annotations.TrustedSandbox])
|
||||
hostNetwork := isTrue(m.Annotations[annotations.HostNetwork])
|
||||
nsOpts := pb.NamespaceOption{}
|
||||
if err := json.Unmarshal([]byte(m.Annotations[annotations.NamespaceOptions]), &nsOpts); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sb, err := sandbox.New(id, m.Annotations[annotations.Namespace], name, m.Annotations[annotations.KubeName], filepath.Dir(m.Annotations[annotations.LogPath]), labels, kubeAnnotations, processLabel, mountLabel, &metadata, m.Annotations[annotations.ShmPath], m.Annotations[annotations.CgroupParent], privileged, trusted, m.Annotations[annotations.ResolvPath], m.Annotations[annotations.HostName], portMappings)
|
||||
if err != nil {
|
||||
|
@ -349,7 +352,7 @@ func (c *ContainerServer) LoadSandbox(id string) error {
|
|||
sb.AddHostnamePath(m.Annotations[annotations.HostnamePath])
|
||||
sb.AddIP(ip)
|
||||
sb.SetSeccompProfilePath(spp)
|
||||
sb.SetHostNetwork(hostNetwork)
|
||||
sb.SetNamespaceOptions(&nsOpts)
|
||||
|
||||
// We add a netNS only if we can load a permanent one.
|
||||
// Otherwise, the sandbox will live in the host namespace.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue