Skip to content

Commit 108af8a

Browse files
author
Ravi Sankar Penta
committed
Bug 1389213 - Fix join/isolate project network
Pass kubeletTypes.ContainerID.ID instead of kubeletTypes.ContainerID.String() to UpdatePod(), Otherwise docker client fails with error: no such container '://<id>'
1 parent 899f139 commit 108af8a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pkg/sdn/plugin/node.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
kapi "k8s.io/kubernetes/pkg/api"
2323
kclient "k8s.io/kubernetes/pkg/client/unversioned"
2424
"k8s.io/kubernetes/pkg/fields"
25-
kubeletTypes "k8s.io/kubernetes/pkg/kubelet/container"
2625
knetwork "k8s.io/kubernetes/pkg/kubelet/network"
2726
"k8s.io/kubernetes/pkg/labels"
2827
kexec "k8s.io/kubernetes/pkg/util/exec"
@@ -216,7 +215,7 @@ func (node *OsdnNode) Start() error {
216215
}
217216
for _, p := range pods {
218217
containerID := getPodContainerID(&p)
219-
err = node.UpdatePod(p.Namespace, p.Name, kubeletTypes.ContainerID{ID: containerID})
218+
err = node.UpdatePod(p.Namespace, p.Name, containerID)
220219
if err != nil {
221220
log.Warningf("Could not update pod %q (%s): %s", p.Name, containerID, err)
222221
}
@@ -234,12 +233,12 @@ func (node *OsdnNode) Start() error {
234233

235234
// FIXME: this should eventually go into kubelet via a CNI UPDATE/CHANGE action
236235
// See https://github.com/containernetworking/cni/issues/89
237-
func (node *OsdnNode) UpdatePod(namespace string, name string, id kubeletTypes.ContainerID) error {
236+
func (node *OsdnNode) UpdatePod(namespace string, name, id string) error {
238237
req := &cniserver.PodRequest{
239238
Command: cniserver.CNI_UPDATE,
240239
PodNamespace: namespace,
241240
PodName: name,
242-
ContainerId: id.String(),
241+
ContainerId: id,
243242
// netns is read from docker if needed, since we don't get it from kubelet
244243
Result: make(chan *cniserver.PodResult),
245244
}

pkg/sdn/plugin/vnids_node.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
kapi "k8s.io/kubernetes/pkg/api"
1111
"k8s.io/kubernetes/pkg/client/cache"
12-
kubetypes "k8s.io/kubernetes/pkg/kubelet/container"
1312
kerrors "k8s.io/kubernetes/pkg/util/errors"
1413
"k8s.io/kubernetes/pkg/util/sets"
1514
utilwait "k8s.io/kubernetes/pkg/util/wait"
@@ -167,7 +166,7 @@ func (node *OsdnNode) updatePodNetwork(namespace string, oldNetID, netID uint32)
167166

168167
// Update OF rules for the existing/old pods in the namespace
169168
for _, pod := range pods {
170-
err = node.UpdatePod(pod.Namespace, pod.Name, kubetypes.ContainerID{ID: getPodContainerID(&pod)})
169+
err = node.UpdatePod(pod.Namespace, pod.Name, getPodContainerID(&pod))
171170
if err != nil {
172171
errList = append(errList, err)
173172
}

0 commit comments

Comments
 (0)