From b8e92305895f164d985c001d30fc65da8f0436b5 Mon Sep 17 00:00:00 2001 From: Kirsten Garrison Date: Mon, 16 Nov 2020 16:09:57 -0800 Subject: [PATCH] move isPoolStatusConditionTrue to standalone func --- pkg/operator/sync.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/operator/sync.go b/pkg/operator/sync.go index afe0b38184..d4e8aec38c 100644 --- a/pkg/operator/sync.go +++ b/pkg/operator/sync.go @@ -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) { @@ -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 +}