Skip to content

Commit f175449

Browse files
feat: updating wait logic
1 parent 0458c64 commit f175449

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

charts/cluster-api-runtime-extensions-nutanix/addons/konnector-agent/values-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ agent:
33
image:
44
repository: quay.io/karbon
55
name: k8s-agent
6+
tag: "1.3.0-rc.1"
67
pc:
78
port: {{ .PrismCentralPort }}
89
insecure: {{ .PrismCentralInsecure }} #set this to true if PC does not have https enabled

pkg/handlers/lifecycle/konnectoragent/handler.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ func (n *DefaultKonnectorAgent) waitForHelmUninstallCompletion(
522522
log logr.Logger,
523523
) error {
524524
// Create a context with timeout to avoid blocking cluster deletion indefinitely
525-
// 90 seconds should be enough for most helm uninstalls while still being reasonable
526-
waitCtx, cancel := context.WithTimeout(ctx, 90*time.Second)
525+
// 30 seconds should be enough for most helm uninstalls while still being reasonable
526+
waitCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
527527
defer cancel()
528528

529529
log.Info("Monitoring HelmChartProxy deletion progress", "name", hcp.Name)
@@ -532,7 +532,7 @@ func (n *DefaultKonnectorAgent) waitForHelmUninstallCompletion(
532532
// This indicates CAAPH has acknowledged the deletion request
533533
err := wait.PollUntilContextTimeout(
534534
waitCtx,
535-
2*time.Second,
535+
3*time.Second,
536536
30*time.Second,
537537
true,
538538
func(pollCtx context.Context) (bool, error) {
@@ -567,20 +567,5 @@ func (n *DefaultKonnectorAgent) waitForHelmUninstallCompletion(
567567
return fmt.Errorf("error waiting for HelmChartProxy deletion: %w", err)
568568
}
569569

570-
// Additional wait to give CAAPH more time to complete the helm uninstall
571-
// even after the HCP is deleted. This accounts for any cleanup operations.
572-
log.Info("HelmChartProxy deleted, allowing additional time for helm uninstall completion")
573-
574-
// Use a shorter additional wait to not delay cluster deletion too much
575-
additionalWaitCtx, additionalCancel := context.WithTimeout(ctx, 30*time.Second)
576-
defer additionalCancel()
577-
578-
select {
579-
case <-additionalWaitCtx.Done():
580-
log.Info("Additional wait period completed, proceeding with cluster deletion")
581-
case <-time.After(10 * time.Second):
582-
log.Info("Reasonable wait time elapsed, proceeding with cluster deletion")
583-
}
584-
585570
return nil
586571
}

0 commit comments

Comments
 (0)