Commit 96c0fe9b authored by yiqinguo's avatar yiqinguo

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

If do not add continue, pod. (* V1.Pod) may cause panic to run.
parent 5ca33f51
...@@ -505,6 +505,7 @@ func (s *podStorage) MergedState() interface{} { ...@@ -505,6 +505,7 @@ func (s *podStorage) MergedState() interface{} {
pod, err := api.Scheme.Copy(podRef) pod, err := api.Scheme.Copy(podRef)
if err != nil { if err != nil {
glog.Errorf("unable to copy pod: %v", err) glog.Errorf("unable to copy pod: %v", err)
continue
} }
pods = append(pods, pod.(*v1.Pod)) pods = append(pods, pod.(*v1.Pod))
} }
...@@ -519,6 +520,7 @@ func copyPods(sourcePods []*v1.Pod) []*v1.Pod { ...@@ -519,6 +520,7 @@ func copyPods(sourcePods []*v1.Pod) []*v1.Pod {
pod, err := api.Scheme.Copy(source) pod, err := api.Scheme.Copy(source)
if err != nil { if err != nil {
glog.Errorf("unable to copy pod: %v", err) glog.Errorf("unable to copy pod: %v", err)
continue
} }
pods = append(pods, pod.(*v1.Pod)) pods = append(pods, pod.(*v1.Pod))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment