If err does not add continue, type conversion will be error.

If do not add continue, pod. (* V1.Pod) may cause panic to run.
pull/6/head
yiqinguo 2017-06-21 15:36:01 +08:00
parent 5ca33f51ac
commit 96c0fe9b11
1 changed files with 2 additions and 0 deletions

View File

@ -505,6 +505,7 @@ func (s *podStorage) MergedState() interface{} {
pod, err := api.Scheme.Copy(podRef)
if err != nil {
glog.Errorf("unable to copy pod: %v", err)
continue
}
pods = append(pods, pod.(*v1.Pod))
}
@ -519,6 +520,7 @@ func copyPods(sourcePods []*v1.Pod) []*v1.Pod {
pod, err := api.Scheme.Copy(source)
if err != nil {
glog.Errorf("unable to copy pod: %v", err)
continue
}
pods = append(pods, pod.(*v1.Pod))
}