File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
pkg/apis/deployment/v1alpha Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -183,25 +183,24 @@ func (l MemberStatusList) AllMembersReady() bool {
183183
184184// AllConditionTrueSince returns true if all members satisfy the condition since the given period
185185func (l MemberStatusList ) AllConditionTrueSince (cond ConditionType , status v1.ConditionStatus , period time.Duration ) bool {
186- trueCount := 0
187186 for _ , x := range l {
188187 if c , ok := x .Conditions .Get (cond ); ok {
189188 if c .Status == status && c .LastTransitionTime .Time .Add (period ).Before (time .Now ()) {
190- trueCount ++
189+ continue
191190 }
192191 }
192+ return false
193193 }
194194
195- return trueCount == len ( l )
195+ return true
196196}
197197
198198// AllFailed returns true if all members are failed
199199func (l MemberStatusList ) AllFailed () bool {
200- failedCount := 0
201200 for _ , x := range l {
202- if x .Phase .IsFailed () {
203- failedCount ++
201+ if ! x .Phase .IsFailed () {
202+ return false
204203 }
205204 }
206- return failedCount == len ( l )
205+ return true
207206}
You can’t perform that action at this time.
0 commit comments