You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// check StatefulSet pod, we will trace it if its controller StatefulSet object was deleted or decreased its replicas and the pod index was out of the replicas.
// check StatefulSet pod, we will trace it if its controller StatefulSet object was deleted or decreased its replicas and the pod index was out of the replicas.
// check StatefulSet pod, we will trace it if its controller StatefulSet object was deleted or decreased its replicas and the pod index was out of the replicas.
@@ -193,8 +204,10 @@ func (s *SpiderGC) executeScanAll(ctx context.Context) {
193
204
flagPodStatusShouldGCIP=true
194
205
}
195
206
} else {
196
-
wrappedLog.Sugar().Infof("pod %s/%s is not a static Pod. the IPPool.Status.AllocatedIPs %s in IPPool %s should be reclaimed. ", podNS, podName, poolIP, pool.Name)
197
-
flagPodStatusShouldGCIP=true
207
+
ifpodYaml.DeletionTimestamp!=nil {
208
+
wrappedLog.Sugar().Infof("Pod %s/%s has been deleting. compare the graceful deletion period if it is over and handle the IP %s in IPPool %s", podNS, podName, poolIP, pool.Name)
scanAllLogger.Sugar().Infof("the graceful deletion period of pod '%s/%s' is over, try to reclaim the IP %s in the IPPool %s.", podNS, podName, poolIP, pool.Name)
210
-
flagPodStatusShouldGCIP=true
211
-
} else {
212
-
wrappedLog:=scanAllLogger.With(zap.String("gc-reason", "The graceful deletion period of kubernetes Pod has not yet ended"))
213
-
iflen(podYaml.Status.PodIPs) !=0 {
214
-
wrappedLog.Sugar().Infof("pod %s/%s still holds the IP address %v. try to track it through trace GC.", podNS, podName, podYaml.Status.PodIPs)
215
-
flagPodStatusShouldGCIP=false
216
-
// The graceful deletion period of kubernetes Pod has not yet ended, and the Pod's already has an IP address. Let trace_worker track and recycle the IP in time.
217
-
// In addition, avoid that all trace data is blank when the controller is just started.
218
-
flagTracePodEntry=true
219
-
} else {
220
-
wrappedLog.Sugar().Infof("pod %s/%s IP has been reclaimed, try to reclaim the IP %s in IPPool %s", podNS, podName, poolIP, pool.Name)
wrappedLog:=scanAllLogger.With(zap.String("gc-reason", fmt.Sprintf("The current state of the Pod %s/%s is: %v", podNS, podName, podYaml.Status.Phase)))
scanAllLogger.Sugar().Infof("the graceful deletion period of pod '%s/%s' is over, try to reclaim the IP %s ", pod.Namespace, pod.Name, &pod.Status.PodIPs)
459
+
ifshouldGcOrTraceStatelessTerminatingPod {
460
+
flagPodStatusShouldGCIP=true
461
+
}
462
+
returnflagPodStatusShouldGCIP, flagTracePodEntry
463
+
}
464
+
wrappedLog:=scanAllLogger.With(zap.String("gc-reason", "The graceful deletion period of kubernetes Pod has not yet ended"))
465
+
iflen(pod.Status.PodIPs) !=0 {
466
+
wrappedLog.Sugar().Infof("pod %s/%s still holds the IP address %v. try to track it through trace GC.", pod.Namespace, pod.Name, pod.Status.PodIPs)
467
+
// The graceful deletion period of kubernetes Pod has not yet ended, and the Pod's already has an IP address. Let trace_worker track and recycle the IP in time.
468
+
// In addition, avoid that all trace data is blank when the controller is just started.
469
+
flagTracePodEntry=true
470
+
} else {
471
+
wrappedLog.Sugar().Infof("pod %s/%s IP has been reclaimed, try to reclaim the IP %s", pod.Namespace, pod.Name, pod.Status.PodIPs)
0 commit comments