@@ -707,6 +707,11 @@ func TestUpdateOperatorStatus(t *testing.T) {
707707 },
708708 Spec : appsv1.DeploymentSpec {
709709 Replicas : ptr.To [int32 ](3 ),
710+ Template : corev1.PodTemplateSpec {
711+ ObjectMeta : metav1.ObjectMeta {
712+ Labels : map [string ]string {"app" : "apiserver" },
713+ },
714+ },
710715 },
711716 Status : appsv1.DeploymentStatus {
712717 AvailableReplicas : 0 ,
@@ -734,7 +739,7 @@ func TestUpdateOperatorStatus(t *testing.T) {
734739 Type : fmt .Sprintf ("%sDeploymentDegraded" , defaultControllerName ),
735740 Status : operatorv1 .ConditionTrue ,
736741 Reason : "UnavailablePod" ,
737- Message : " 3 of 3 requested instances are unavailable for apiserver.openshift-apiserver" ,
742+ Message : ` 3 of 3 requested instances are unavailable for apiserver.openshift-apiserver (no pods found with labels "app=apiserver")` ,
738743 },
739744 {
740745 Type : fmt .Sprintf ("%sDeployment%s" , defaultControllerName , operatorv1 .OperatorStatusTypeProgressing ),
@@ -861,7 +866,7 @@ func TestUpdateOperatorStatus(t *testing.T) {
861866 // Combined deadline: 600+60 = 660s (11m).
862867 // Pod created 15m ago → past combined deadline → check is relevant.
863868 // LastTransitionTime 10s ago < MinReadySeconds (60s) → flapping → degraded.
864- name : "scenario: pod with flapping Ready condition detected as failing" ,
869+ name : "scenario: pod with flapping Ready condition after successful rollout detected as failing" ,
865870 workload : & appsv1.Deployment {
866871 ObjectMeta : metav1.ObjectMeta {
867872 Name : "apiserver" ,
@@ -925,7 +930,7 @@ func TestUpdateOperatorStatus(t *testing.T) {
925930 // MinReadySeconds=300, ProgressDeadlineSeconds defaults to 600.
926931 // Combined deadline: 600+300 = 900s (15m).
927932 // Pod created 8m ago → still within combined deadline → check not relevant → not degraded.
928- name : "scenario: pod with flapping Ready condition within combined deadline not flagged" ,
933+ name : "scenario: pod with flapping Ready condition after successful rollout within combined deadline not flagged" ,
929934 workload : & appsv1.Deployment {
930935 ObjectMeta : metav1.ObjectMeta {
931936 Name : "apiserver" ,
@@ -986,7 +991,7 @@ func TestUpdateOperatorStatus(t *testing.T) {
986991 // Combined deadline: 600+60 = 660s (11m).
987992 // Pod created 15m ago → past combined deadline → check is relevant.
988993 // LastTransitionTime 5m ago > MinReadySeconds (60s) → stable → not degraded.
989- name : "scenario: stably ready pod past combined deadline not flagged as flapping" ,
994+ name : "scenario: stably ready pod after successful rollout past combined deadline not flagged as flapping" ,
990995 workload : & appsv1.Deployment {
991996 ObjectMeta : metav1.ObjectMeta {
992997 Name : "apiserver" ,
@@ -1016,6 +1021,15 @@ func TestUpdateOperatorStatus(t *testing.T) {
10161021 },
10171022 },
10181023 },
1024+ {
1025+ ObjectMeta : metav1.ObjectMeta {Name : "apiserver-2" , Namespace : "openshift-apiserver" , CreationTimestamp : metav1 .NewTime (time .Now ().Add (- 10 * time .Second ))},
1026+ Status : corev1.PodStatus {
1027+ Phase : corev1 .PodRunning ,
1028+ Conditions : []corev1.PodCondition {
1029+ {Type : corev1 .PodReady , Status : corev1 .ConditionTrue , LastTransitionTime : metav1 .NewTime (time .Now ().Add (- 10 * time .Second ))},
1030+ },
1031+ },
1032+ },
10191033 },
10201034 validateOperatorStatus : func (actualStatus * operatorv1.OperatorStatus ) error {
10211035 expectedConditions := []operatorv1.OperatorCondition {
0 commit comments