Skip to content

Commit daeeb40

Browse files
adding hrp ready condition check
Signed-off-by: Chaitanya Kolluru <[email protected]>
1 parent 0d755be commit daeeb40

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

controllers/helmchartproxy/helmchartproxy_controller.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ type helmReleaseProxyRolloutMeta struct {
5555

5656
// Identifies whether HelmReleaseProxy exists for the cluster.
5757
hrpExists bool
58+
59+
// Identifies whether HelmReleaseProxy's ready condition is True.
60+
hrpReady bool
5861
}
5962

6063
// SetupWithManager sets up the controller with the Manager.
@@ -238,6 +241,7 @@ func (r *HelmChartProxyReconciler) reconcileNormal(ctx context.Context, helmChar
238241
nn := getNamespacedNameStringFor(ref.Namespace, ref.Name)
239242
meta := clusterNnRolloutMeta[nn]
240243
meta.hrpExists = true
244+
meta.hrpReady = conditions.IsTrue(&h, addonsv1alpha1.HelmReleaseReadyCondition)
241245
}
242246

243247
// Sort helmReleaseProxy rollout metadata by cluster namespaced name to
@@ -288,7 +292,14 @@ func (r *HelmChartProxyReconciler) reconcileNormal(ctx context.Context, helmChar
288292
if err != nil {
289293
return err
290294
}
295+
291296
for _, meta := range rolloutMetaSorted {
297+
// Exit if HelmReleaseProxyReadyCondition has not caught up to existing
298+
// HelmReleaseProxies status.
299+
if meta.hrpExists && !meta.hrpReady {
300+
return nil
301+
}
302+
292303
// The next batch of helmReleaseProxies have been reconciled.
293304
if count >= stepSize {
294305
return nil
@@ -304,7 +315,6 @@ func (r *HelmChartProxyReconciler) reconcileNormal(ctx context.Context, helmChar
304315
}
305316
count++
306317
}
307-
308318
// In cases where the count of remaining HelmReleaseProxies to be rolled
309319
// out is less than rollout step size.
310320
return nil

0 commit comments

Comments
 (0)