@@ -22,7 +22,6 @@ import (
22
22
kapi "k8s.io/kubernetes/pkg/api"
23
23
kclient "k8s.io/kubernetes/pkg/client/unversioned"
24
24
"k8s.io/kubernetes/pkg/fields"
25
- kubeletTypes "k8s.io/kubernetes/pkg/kubelet/container"
26
25
knetwork "k8s.io/kubernetes/pkg/kubelet/network"
27
26
"k8s.io/kubernetes/pkg/labels"
28
27
kexec "k8s.io/kubernetes/pkg/util/exec"
@@ -215,10 +214,9 @@ func (node *OsdnNode) Start() error {
215
214
return err
216
215
}
217
216
for _ , p := range pods {
218
- containerID := getPodContainerID (& p )
219
- err = node .UpdatePod (p .Namespace , p .Name , kubeletTypes.ContainerID {ID : containerID })
217
+ err = node .UpdatePod (p )
220
218
if err != nil {
221
- log .Warningf ("Could not update pod %q (%s) : %s" , p .Name , containerID , err )
219
+ log .Warningf ("Could not update pod %q: %s" , p .Name , err )
222
220
}
223
221
}
224
222
}
@@ -234,12 +232,12 @@ func (node *OsdnNode) Start() error {
234
232
235
233
// FIXME: this should eventually go into kubelet via a CNI UPDATE/CHANGE action
236
234
// See https://github.com/containernetworking/cni/issues/89
237
- func (node * OsdnNode ) UpdatePod (namespace string , name string , id kubeletTypes. ContainerID ) error {
235
+ func (node * OsdnNode ) UpdatePod (pod kapi. Pod ) error {
238
236
req := & cniserver.PodRequest {
239
237
Command : cniserver .CNI_UPDATE ,
240
- PodNamespace : namespace ,
241
- PodName : name ,
242
- ContainerId : id . String ( ),
238
+ PodNamespace : pod . Namespace ,
239
+ PodName : pod . Name ,
240
+ ContainerId : getPodContainerID ( & pod ),
243
241
// netns is read from docker if needed, since we don't get it from kubelet
244
242
Result : make (chan * cniserver.PodResult ),
245
243
}
0 commit comments