feat: wait until helm charts are installed before marking a deploy as failed or completed

This ensures applications are actually up vs giving a false sense of security to users about the state of their applications.
This commit is contained in:
Jose Diaz-Gonzalez committed 2024-03-12 08:39:22 -04:00
1 parent 7c61b53cc8
commit c840fc5f9e
5 files changed
+13 -24

No files matched your search

+9
View File
@@ -226,6 +226,7 @@ func applyKedaClusterTriggerAuthentications(ctx context.Context, triggerType str
ReleaseName: fmt.Sprintf("keda-cluster-trigger-authentications-%s", triggerType),
RollbackOnFailure: true,
Timeout: timeoutDuration,
Wait: true,
})
if err != nil {
return fmt.Errorf("Error installing keda-cluster-trigger-authentications-%s chart: %w", triggerType, err)
@@ -333,6 +334,7 @@ func applyClusterIssuers(ctx context.Context) error {
ReleaseName: "cluster-issuers",
RollbackOnFailure: true,
Timeout: timeoutDuration,
Wait: true,
})
if err != nil {
return fmt.Errorf("Error installing cluster-issuer chart: %w", err)
@@ -1398,6 +1400,11 @@ func installHelmCharts(ctx context.Context, clientset KubernetesClient, shouldIn
return fmt.Errorf("Error creating helm agent: %w", err)
}
timeoutDuration, err := time.ParseDuration("300s")
if err != nil {
return fmt.Errorf("Error parsing deploy timeout duration: %w", err)
}
err = helmAgent.InstallOrUpgradeChart(ctx, ChartInput{
ChartPath: chart.ChartPath,
Namespace: chart.Namespace,
@@ -1405,6 +1412,8 @@ func installHelmCharts(ctx context.Context, clientset KubernetesClient, shouldIn
RepoURL: chart.RepoURL,
Values: values,
Version: chart.Version,
Timeout: timeoutDuration,
Wait: true,
})
if err != nil {
return fmt.Errorf("Error installing chart %s: %w", chart.ChartPath, err)