@@ -95,7 +95,7 @@ var _ = Describe("ExtendedDaemonSet e2e updates and recovery", func() {
95
95
},
96
96
}
97
97
98
- eds := testutils .NewExtendedDaemonset (namespace , name , "k8s.gcr. io/pause:latest " , edsOptions )
98
+ eds := testutils .NewExtendedDaemonset (namespace , name , "registry. k8s.io/pause:3.0 " , edsOptions )
99
99
Expect (k8sClient .Create (ctx , eds )).Should (Succeed ())
100
100
101
101
eds = & datadoghqv1alpha1.ExtendedDaemonSet {}
@@ -238,6 +238,7 @@ var _ = Describe("ExtendedDaemonSet e2e updates and recovery", func() {
238
238
return len (pods .Items ) == 0
239
239
}), longTimeout , interval ).Should (BeTrue (), "All EDS pods should be destroyed" )
240
240
})
241
+
241
242
})
242
243
})
243
244
@@ -271,7 +272,7 @@ var _ = Describe("ExtendedDaemonSet e2e PodCannotStart condition", func() {
271
272
},
272
273
}
273
274
274
- eds := testutils .NewExtendedDaemonset (namespace , name , "k8s.gcr. io/pause:latest " , edsOptions )
275
+ eds := testutils .NewExtendedDaemonset (namespace , name , "registry. k8s.io/pause:3.0 " , edsOptions )
275
276
Expect (k8sClient .Create (ctx , eds )).Should (Succeed ())
276
277
277
278
eds = & datadoghqv1alpha1.ExtendedDaemonSet {}
@@ -465,7 +466,7 @@ var _ = Describe("ExtendedDaemonSet e2e successful canary deployment update", fu
465
466
},
466
467
}
467
468
468
- eds := testutils .NewExtendedDaemonset (namespace , name , "k8s.gcr. io/pause:latest " , edsOptions )
469
+ eds := testutils .NewExtendedDaemonset (namespace , name , "registry. k8s.io/pause:3.0 " , edsOptions )
469
470
Expect (k8sClient .Create (ctx , eds )).Should (Succeed ())
470
471
471
472
eds = & datadoghqv1alpha1.ExtendedDaemonSet {}
@@ -486,7 +487,7 @@ var _ = Describe("ExtendedDaemonSet e2e successful canary deployment update", fu
486
487
487
488
It ("Should do canary deployment" , func () {
488
489
updateFunc := func (eds * datadoghqv1alpha1.ExtendedDaemonSet ) {
489
- eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("k8s.gcr .io/pause:3.1" )
490
+ eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("registry.k8s .io/pause:3.1" )
490
491
}
491
492
492
493
Eventually (updateEDS (k8sClient , key , updateFunc ), timeout , interval ).Should (
@@ -527,7 +528,7 @@ var _ = Describe("ExtendedDaemonSet e2e successful canary deployment update", fu
527
528
eds .Annotations = make (map [string ]string )
528
529
}
529
530
eds .Annotations [datadoghqv1alpha1 .ExtendedDaemonSetCanaryValidAnnotationKey ] = canaryReplicaSet
530
- eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("k8s.gcr .io/pause:3.1" )
531
+ eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("registry.k8s .io/pause:3.1" )
531
532
}
532
533
533
534
Eventually (updateEDS (k8sClient , key , updateFunc ), timeout , interval ).Should (
@@ -628,7 +629,7 @@ var _ = Describe("ExtendedDaemonSet Controller", func() {
628
629
},
629
630
ReconcileFrequency : reconcileFrequency ,
630
631
}
631
- eds := testutils .NewExtendedDaemonset (namespace , name , "k8s.gcr. io/pause:latest " , edsOptions )
632
+ eds := testutils .NewExtendedDaemonset (namespace , name , "registry. k8s.io/pause:3.0 " , edsOptions )
632
633
Expect (k8sClient .Create (ctx , eds )).Should (Succeed ())
633
634
634
635
eds = & datadoghqv1alpha1.ExtendedDaemonSet {}
@@ -712,7 +713,7 @@ var _ = Describe("ExtendedDaemonSet e2e validationMode setting", func() {
712
713
},
713
714
}
714
715
715
- eds := testutils .NewExtendedDaemonset (namespace , name , "k8s.gcr. io/pause:latest " , edsOptions )
716
+ eds := testutils .NewExtendedDaemonset (namespace , name , "registry. k8s.io/pause:3.0 " , edsOptions )
716
717
Expect (k8sClient .Create (ctx , eds )).Should (Succeed ())
717
718
718
719
eds = & datadoghqv1alpha1.ExtendedDaemonSet {}
@@ -733,7 +734,7 @@ var _ = Describe("ExtendedDaemonSet e2e validationMode setting", func() {
733
734
734
735
It ("Should do canary deployment" , func () {
735
736
updateFunc := func (eds * datadoghqv1alpha1.ExtendedDaemonSet ) {
736
- eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("k8s.gcr .io/pause:3.1" )
737
+ eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("registry.k8s .io/pause:3.1" )
737
738
}
738
739
739
740
Eventually (updateEDS (k8sClient , key , updateFunc ), timeout , interval ).Should (
@@ -778,6 +779,120 @@ var _ = Describe("ExtendedDaemonSet e2e validationMode setting", func() {
778
779
})
779
780
})
780
781
782
+ // These tests may take several minutes to run, check your go test timeout
783
+ var _ = Describe ("ExtendedDaemonSet e2e rollout not blocked due to already failing pods" , func () {
784
+ Context ("Deployment with failure pods then rollout to healthy pods" , func () {
785
+ name := "eds-fail"
786
+
787
+ key := types.NamespacedName {
788
+ Namespace : namespace ,
789
+ Name : name ,
790
+ }
791
+
792
+ nodeList := & corev1.NodeList {}
793
+
794
+ It ("Should deploy EDS" , func () {
795
+ Expect (k8sClient .List (ctx , nodeList )).Should (Succeed ())
796
+
797
+ edsOptions := & testutils.NewExtendedDaemonsetOptions {
798
+ CanaryStrategy : & datadoghqv1alpha1.ExtendedDaemonSetSpecStrategyCanary {
799
+ Duration : & metav1.Duration {Duration : 1 * time .Minute },
800
+ Replicas : & intString1 ,
801
+ },
802
+ RollingUpdate : & datadoghqv1alpha1.ExtendedDaemonSetSpecStrategyRollingUpdate {
803
+ MaxUnavailable : & intString1 ,
804
+ MaxParallelPodCreation : datadoghqv1alpha1 .NewInt32 (20 ),
805
+ },
806
+ }
807
+
808
+ corrupted_image := "corrupted_image:image_corrupted"
809
+ eds := testutils .NewExtendedDaemonset (namespace , name , corrupted_image , edsOptions )
810
+ Expect (k8sClient .Create (ctx , eds )).Should (Succeed ())
811
+
812
+ eds = & datadoghqv1alpha1.ExtendedDaemonSet {}
813
+ Eventually (withEDS (key , eds , func () bool {
814
+ return eds .Status .ActiveReplicaSet != ""
815
+ }), timeout , interval ).Should (BeTrue ())
816
+
817
+ ers := & datadoghqv1alpha1.ExtendedDaemonSetReplicaSet {}
818
+ ersKey := types.NamespacedName {
819
+ Namespace : namespace ,
820
+ Name : eds .Status .ActiveReplicaSet ,
821
+ }
822
+ Eventually (withERS (ersKey , ers , func () bool {
823
+ return ers .Status .Status == "active" && int (ers .Status .Current ) == len (nodeList .Items ) && int (ers .Status .Ready ) == 0
824
+ }), timeout , interval ).Should (BeTrue ())
825
+
826
+ })
827
+
828
+ It ("Should deploy canary ERS" , func () {
829
+ updateFunc := func (eds * datadoghqv1alpha1.ExtendedDaemonSet ) {
830
+ eds .Spec .Template .Spec .Containers [0 ].Image = fmt .Sprintf ("registry.k8s.io/pause:3.0" )
831
+ }
832
+
833
+ Eventually (updateEDS (k8sClient , key , updateFunc ), timeout , interval ).Should (
834
+ BeTrue (),
835
+ func () string { return "Unable to update the EDS" },
836
+ )
837
+
838
+ eds := & datadoghqv1alpha1.ExtendedDaemonSet {}
839
+ Expect (k8sClient .Get (ctx , key , eds )).Should (Succeed ())
840
+
841
+ Eventually (withEDS (key , eds , func () bool {
842
+ return eds .Status .State == datadoghqv1alpha1 .ExtendedDaemonSetStatusStateCanary
843
+ }), timeout , interval ).Should (BeTrue ())
844
+ })
845
+
846
+ It ("Should rollout successfully after success of canary - canary ERS should become active ERS" , func () {
847
+ eds := & datadoghqv1alpha1.ExtendedDaemonSet {}
848
+ Expect (k8sClient .Get (ctx , key , eds )).Should (Succeed ())
849
+
850
+ Eventually (withEDS (key , eds , func () bool {
851
+ return eds .Status .State == datadoghqv1alpha1 .ExtendedDaemonSetStatusStateCanary
852
+ }), timeout , interval ).Should (BeTrue ())
853
+
854
+ ersCanary := & datadoghqv1alpha1.ExtendedDaemonSetReplicaSet {}
855
+ ersCanaryKey := types.NamespacedName {
856
+ Namespace : namespace ,
857
+ Name : eds .Status .Canary .ReplicaSet ,
858
+ }
859
+
860
+ Eventually (withERS (ersCanaryKey , ersCanary , func () bool {
861
+ return ersCanary .Status .Status == "canary"
862
+ }), timeout , interval ).Should (BeTrue ())
863
+
864
+ Eventually (withEDS (key , eds , func () bool {
865
+ return eds .Status .State == datadoghqv1alpha1 .ExtendedDaemonSetStatusStateRunning
866
+ }), longTimeout , interval ).Should (BeTrue ())
867
+
868
+ ers := & datadoghqv1alpha1.ExtendedDaemonSetReplicaSet {}
869
+ ersKey := types.NamespacedName {
870
+ Namespace : namespace ,
871
+ Name : eds .Status .ActiveReplicaSet ,
872
+ }
873
+
874
+ Eventually (withERS (ersKey , ers , func () bool {
875
+ return ers .Status .Status == "active" && int (ers .Status .Available ) == len (nodeList .Items )
876
+ }), timeout , interval ).Should (BeTrue ())
877
+ })
878
+
879
+ It ("Should delete EDS" , func () {
880
+ Eventually (deleteEDS (k8sClient , key ), timeout , interval ).Should (BeTrue (), "EDS should be deleted" )
881
+
882
+ pods := & corev1.PodList {}
883
+ listOptions := []client.ListOption {
884
+ client .InNamespace (namespace ),
885
+ client.MatchingLabels {
886
+ datadoghqv1alpha1 .ExtendedDaemonSetNameLabelKey : name ,
887
+ },
888
+ }
889
+ Eventually (withList (listOptions , pods , "EDS pods" , func () bool {
890
+ return len (pods .Items ) == 0
891
+ }), longTimeout , interval ).Should (BeTrue (), "All EDS pods should be destroyed" )
892
+ })
893
+ })
894
+ })
895
+
781
896
func withUpdate (obj client.Object , desc string ) condFn {
782
897
return func () bool {
783
898
err := k8sClient .Update (context .Background (), obj )
0 commit comments