Skip to content

Commit

Permalink
move isPoolStatusConditionTrue to standalone func
Browse files Browse the repository at this point in the history
  • Loading branch information
kikisdeliveryservice committed Nov 21, 2020
1 parent 154e72b commit b8e9230
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/operator/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,6 @@ func (optr *Operator) syncRequiredMachineConfigPools(_ *renderConfig) error {
if err != nil {
return err
}
isPoolStatusConditionTrue := func(pool *mcfgv1.MachineConfigPool, conditionType mcfgv1.MachineConfigPoolConditionType) bool {
for _, condition := range pool.Status.Conditions {
if condition.Type == conditionType {
return condition.Status == corev1.ConditionTrue
}
}
return false
}

var lastErr error
if err := wait.Poll(time.Second, 10*time.Minute, func() (bool, error) {
Expand Down Expand Up @@ -843,3 +835,12 @@ func mergeCertWithCABundle(initialBundle, newBundle []byte, subject string) []by
}
return mergedBytes
}

func isPoolStatusConditionTrue(pool *mcfgv1.MachineConfigPool, conditionType mcfgv1.MachineConfigPoolConditionType) bool {
for _, condition := range pool.Status.Conditions {
if condition.Type == conditionType {
return condition.Status == corev1.ConditionTrue
}
}
return false
}

0 comments on commit b8e9230

Please sign in to comment.