@@ -83,7 +83,7 @@ var _ = Describe("Mysql cluster reconcilation", func() {
8383
8484 It ("should update status" , func () {
8585 orcClient .AddInstance ("asd.default" , cluster .GetPodHostname (0 ),
86- true , - 1 , false )
86+ true , - 1 , false , true )
8787 orcClient .AddRecoveries ("asd.default" , 1 , true )
8888 factory .createPod ("asd-mysql-0" )
8989
@@ -104,7 +104,7 @@ var _ = Describe("Mysql cluster reconcilation", func() {
104104
105105 It ("should have pending recoveries" , func () {
106106 orcClient .AddInstance ("asd.default" , cluster .GetPodHostname (0 ),
107- true , - 1 , false )
107+ true , - 1 , false , true )
108108 orcClient .AddRecoveries ("asd.default" , 11 , false )
109109 Ω (factory .SyncOrchestratorStatus (ctx )).Should (Succeed ())
110110 Expect (getCCond (
@@ -114,7 +114,7 @@ var _ = Describe("Mysql cluster reconcilation", func() {
114114
115115 It ("should have pending recoveries but cluster not ready enough" , func () {
116116 orcClient .AddInstance ("asd.default" , cluster .GetPodHostname (0 ),
117- true , - 1 , false )
117+ true , - 1 , false , true )
118118 orcClient .AddRecoveries ("asd.default" , 111 , false )
119119 cluster .UpdateStatusCondition (api .ClusterConditionReady , core .ConditionTrue , "" , "" )
120120 Ω (factory .SyncOrchestratorStatus (ctx )).Should (Succeed ())
@@ -126,7 +126,7 @@ var _ = Describe("Mysql cluster reconcilation", func() {
126126
127127 It ("should have pending recoveries that will be recovered" , func () {
128128 orcClient .AddInstance ("asd.default" , cluster .GetPodHostname (0 ),
129- true , - 1 , false )
129+ true , - 1 , false , true )
130130 orcClient .AddRecoveries ("asd.default" , 112 , false )
131131 min20 , _ := time .ParseDuration ("-20m" )
132132 cluster .Status .Conditions = []api.ClusterCondition {
@@ -148,6 +148,31 @@ var _ = Describe("Mysql cluster reconcilation", func() {
148148 Expect (event ).To (ContainSubstring ("RecoveryAcked" ))
149149 })
150150
151+ It ("node not uptodate in orc" , func () {
152+ orcClient .AddInstance ("asd.default" , cluster .GetPodHostname (0 ),
153+ true , - 1 , false , false )
154+ Ω (factory .SyncOrchestratorStatus (ctx )).Should (Succeed ())
155+
156+ Expect (cluster .Status .Nodes [0 ].GetCondition (api .NodeConditionMaster ).Status ).To (
157+ Equal (core .ConditionUnknown ))
158+ })
159+
160+ It ("node not in orc" , func () {
161+ orcClient .AddInstance ("asd.default" , cluster .GetPodHostname (0 ),
162+ true , - 1 , false , true )
163+ Ω (factory .SyncOrchestratorStatus (ctx )).Should (Succeed ())
164+
165+ Expect (cluster .Status .Nodes [0 ].GetCondition (api .NodeConditionMaster ).Status ).To (
166+ Equal (core .ConditionTrue ))
167+
168+ orcClient .RemoveInstance ("asd.default" , cluster .GetPodHostname (0 ))
169+ Ω (factory .SyncOrchestratorStatus (ctx )).Should (Succeed ())
170+
171+ Expect (cluster .Status .Nodes [0 ].GetCondition (api .NodeConditionMaster ).Status ).To (
172+ Equal (core .ConditionUnknown ))
173+
174+ })
175+
151176 })
152177 })
153178})
0 commit comments