@@ -86,14 +86,14 @@ func checkAutomationStatusIsGoal(as *AutomationStatus, relevantProcesses []strin
86
86
goalsNotAchievedMap := map [string ]int {}
87
87
goalsAchievedMap := map [string ]int {}
88
88
authTransitionInProgress := map [string ]string {}
89
-
89
+
90
90
for _ , p := range as .Processes {
91
91
if ! stringutil .Contains (relevantProcesses , p .Name ) {
92
92
continue
93
93
}
94
94
if p .LastGoalVersionAchieved == as .GoalVersion {
95
95
goalsAchievedMap [p .Name ] = p .LastGoalVersionAchieved
96
-
96
+
97
97
// Check if authentication transitions are in the current plan
98
98
// If a process has reached goal version but still has auth-related moves in plan,
99
99
// it means authentication transition is likely in progress
@@ -122,9 +122,9 @@ func checkAutomationStatusIsGoal(as *AutomationStatus, relevantProcesses []strin
122
122
for processName , step := range authTransitionInProgress {
123
123
authTransitionMsgList = append (authTransitionMsgList , fmt .Sprintf ("%s:%s" , processName , step ))
124
124
}
125
- log .Infow ("Authentication transitions still in progress, waiting for completion" ,
125
+ log .Infow ("Authentication transitions still in progress, waiting for completion" ,
126
126
"processes" , authTransitionMsgList )
127
- return false , fmt .Sprintf ("authentication transitions in progress for %d processes: %s" ,
127
+ return false , fmt .Sprintf ("authentication transitions in progress for %d processes: %s" ,
128
128
len (authTransitionInProgress ), authTransitionMsgList )
129
129
}
130
130
@@ -140,22 +140,17 @@ func checkAutomationStatusIsGoal(as *AutomationStatus, relevantProcesses []strin
140
140
141
141
// isAuthenticationTransitionMove returns true if the given move is related to authentication transitions
142
142
func isAuthenticationTransitionMove (move string ) bool {
143
- // Authentication-related moves that can appear in the automation plan
144
- // Based on analysis of failed test showing auth transition in progress
145
- authMoves := []string {
146
- "RestartMongod" , // Often involved in authentication mode changes
147
- "UpdateAuth" , // Direct authentication update moves
148
- "UpdateConfig" , // Configuration updates that may include auth changes
149
- "WaitForHealthy" , // Waiting for cluster health after auth changes
150
- "InitiateReplSet" , // ReplicaSet initialization with authentication
151
- }
152
-
153
- for _ , authMove := range authMoves {
154
- if move == authMove {
155
- return true
156
- }
143
+ authMoves := map [string ]struct {}{
144
+ "RestartMongod" : {},
145
+ "UpdateAuth" : {},
146
+ "UpdateConfig" : {},
147
+ "WaitForHealthy" : {},
148
+ "InitiateReplSet" : {},
157
149
}
158
- return false
150
+
151
+ _ , ok := authMoves [move ]
152
+
153
+ return ok
159
154
}
160
155
161
156
func areAnyAgentsInKubeUpgradeMode (as * AutomationStatus , relevantProcesses []string , log * zap.SugaredLogger ) bool {
0 commit comments