mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 12:11:43 +00:00
If err does not add continue, type conversion will be error.
If do not add continue, pod. (* V1.Pod) may cause panic to run.
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user