1
0
mirror of synced 2026-03-20 01:26:57 +00:00

Use LastHandledReconcileAt in reconcile commands

This commit is contained in:
Hidde Beydals
2020-09-30 23:21:32 +02:00
parent f216273008
commit 84e36ed847
4 changed files with 103 additions and 53 deletions

View File

@@ -286,3 +286,28 @@ func isHelmChartReady(ctx context.Context, kubeClient client.Client, name, names
return false, nil
}
}
func isHelmReleaseReady(ctx context.Context, kubeClient client.Client, name, namespace string) wait.ConditionFunc {
return func() (bool, error) {
var helmRelease helmv2.HelmRelease
namespacedName := types.NamespacedName{
Namespace: namespace,
Name: name,
}
err := kubeClient.Get(ctx, namespacedName, &helmRelease)
if err != nil {
return false, err
}
if c := meta.GetCondition(helmRelease.Status.Conditions, meta.ReadyCondition); c != nil {
switch c.Status {
case corev1.ConditionTrue:
return true, nil
case corev1.ConditionFalse:
return false, fmt.Errorf(c.Message)
}
}
return false, nil
}
}