@@ -690,6 +690,14 @@ func TestOperatorSyncStatus(t *testing.T) {
690
690
configMapIndexer := cache .NewIndexer (cache .MetaNamespaceKeyFunc , cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc })
691
691
optr .mcoCmLister = corelisterv1 .NewConfigMapLister (configMapIndexer )
692
692
693
+ configNode := & configv1.Node {
694
+ ObjectMeta : metav1.ObjectMeta {Name : ctrlcommon .ClusterNodeInstanceName },
695
+ Spec : configv1.NodeSpec {},
696
+ }
697
+ configNodeIndexer := cache .NewIndexer (cache .MetaNamespaceKeyFunc , cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc })
698
+ optr .nodeClusterLister = configlistersv1 .NewNodeLister (configNodeIndexer )
699
+ configNodeIndexer .Add (configNode )
700
+
693
701
for j , sync := range testCase .syncs {
694
702
optr .inClusterBringup = sync .inClusterBringUp
695
703
if sync .nextVersion != "" {
@@ -755,6 +763,14 @@ func TestInClusterBringUpStayOnErr(t *testing.T) {
755
763
},
756
764
},
757
765
}
766
+
767
+ configNode := & configv1.Node {
768
+ ObjectMeta : metav1.ObjectMeta {Name : ctrlcommon .ClusterNodeInstanceName },
769
+ Spec : configv1.NodeSpec {},
770
+ }
771
+ configNodeIndexer := cache .NewIndexer (cache .MetaNamespaceKeyFunc , cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc })
772
+ optr .nodeClusterLister = configlistersv1 .NewNodeLister (configNodeIndexer )
773
+ configNodeIndexer .Add (configNode )
758
774
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorAvailable , Status : configv1 .ConditionFalse })
759
775
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorProgressing , Status : configv1 .ConditionFalse })
760
776
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorDegraded , Status : configv1 .ConditionFalse })
@@ -821,6 +837,13 @@ func TestKubeletSkewUnSupported(t *testing.T) {
821
837
})
822
838
823
839
co := & configv1.ClusterOperator {}
840
+ configNode := & configv1.Node {
841
+ ObjectMeta : metav1.ObjectMeta {Name : ctrlcommon .ClusterNodeInstanceName },
842
+ Spec : configv1.NodeSpec {},
843
+ }
844
+ configNodeIndexer := cache .NewIndexer (cache .MetaNamespaceKeyFunc , cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc })
845
+ optr .nodeClusterLister = configlistersv1 .NewNodeLister (configNodeIndexer )
846
+ configNodeIndexer .Add (configNode )
824
847
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorAvailable , Status : configv1 .ConditionFalse })
825
848
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorProgressing , Status : configv1 .ConditionFalse })
826
849
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorDegraded , Status : configv1 .ConditionFalse })
@@ -920,6 +943,13 @@ func TestCustomPoolKubeletSkewUnSupported(t *testing.T) {
920
943
})
921
944
922
945
co := & configv1.ClusterOperator {}
946
+ configNode := & configv1.Node {
947
+ ObjectMeta : metav1.ObjectMeta {Name : ctrlcommon .ClusterNodeInstanceName },
948
+ Spec : configv1.NodeSpec {},
949
+ }
950
+ configNodeIndexer := cache .NewIndexer (cache .MetaNamespaceKeyFunc , cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc })
951
+ optr .nodeClusterLister = configlistersv1 .NewNodeLister (configNodeIndexer )
952
+ configNodeIndexer .Add (configNode )
923
953
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorAvailable , Status : configv1 .ConditionFalse })
924
954
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorProgressing , Status : configv1 .ConditionFalse })
925
955
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorDegraded , Status : configv1 .ConditionFalse })
@@ -1017,6 +1047,13 @@ func TestKubeletSkewSupported(t *testing.T) {
1017
1047
})
1018
1048
1019
1049
co := & configv1.ClusterOperator {}
1050
+ configNode := & configv1.Node {
1051
+ ObjectMeta : metav1.ObjectMeta {Name : ctrlcommon .ClusterNodeInstanceName },
1052
+ Spec : configv1.NodeSpec {},
1053
+ }
1054
+ configNodeIndexer := cache .NewIndexer (cache .MetaNamespaceKeyFunc , cache.Indexers {cache .NamespaceIndex : cache .MetaNamespaceIndexFunc })
1055
+ optr .nodeClusterLister = configlistersv1 .NewNodeLister (configNodeIndexer )
1056
+ configNodeIndexer .Add (configNode )
1020
1057
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorAvailable , Status : configv1 .ConditionFalse })
1021
1058
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorProgressing , Status : configv1 .ConditionFalse })
1022
1059
cov1helpers .SetStatusCondition (& co .Status .Conditions , configv1.ClusterOperatorStatusCondition {Type : configv1 .OperatorDegraded , Status : configv1 .ConditionFalse })
0 commit comments