mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Tighten DS rollout catching function
This commit is contained in:
parent
862aa6d3a0
commit
f339061816
@ -1050,6 +1050,10 @@ func checkDaemonPodsImageAndAvailability(c clientset.Interface, ds *appsv1.Daemo
|
|||||||
unavailablePods := 0
|
unavailablePods := 0
|
||||||
nodesToUpdatedPodCount := make(map[string]int)
|
nodesToUpdatedPodCount := make(map[string]int)
|
||||||
for _, pod := range pods {
|
for _, pod := range pods {
|
||||||
|
// Ignore the pod on the node that is supposed to be deleted
|
||||||
|
if pod.DeletionTimestamp != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !metav1.IsControlledBy(&pod, ds) {
|
if !metav1.IsControlledBy(&pod, ds) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -1080,6 +1084,10 @@ func checkDaemonPodsImageAndAvailability(c clientset.Interface, ds *appsv1.Daemo
|
|||||||
|
|
||||||
func checkDaemonSetPodsLabels(podList *v1.PodList, hash string) {
|
func checkDaemonSetPodsLabels(podList *v1.PodList, hash string) {
|
||||||
for _, pod := range podList.Items {
|
for _, pod := range podList.Items {
|
||||||
|
// Ignore all the DS pods that will be deleted
|
||||||
|
if pod.DeletionTimestamp != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
podHash := pod.Labels[appsv1.DefaultDaemonSetUniqueLabelKey]
|
podHash := pod.Labels[appsv1.DefaultDaemonSetUniqueLabelKey]
|
||||||
gomega.Expect(len(podHash)).To(gomega.BeNumerically(">", 0))
|
gomega.Expect(len(podHash)).To(gomega.BeNumerically(">", 0))
|
||||||
if len(hash) > 0 {
|
if len(hash) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user