Skip to content

Commit f54bf1d

Browse files
committed
(chore) log deployment errors
1 parent aaa98e2 commit f54bf1d

4 files changed

Lines changed: 23 additions & 6 deletions

File tree

controllers/clustersummary_deployer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ func (r *ClusterSummaryReconciler) proceedDeployingFeature(ctx context.Context,
145145

146146
if deployerStatus != nil {
147147
logger.V(logs.LogDebug).Info(fmt.Sprintf("deployer result is available: %v", *deployerStatus))
148+
if deployerError != nil {
149+
logger.V(logs.LogDebug).Error(deployerError, "deployer error")
150+
}
148151

149152
if *deployerStatus == libsveltosv1beta1.FeatureStatusProvisioned {
150153
if isPullMode {

controllers/handlers_helm.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ var (
9292
)
9393

9494
const (
95-
writeFilePermission = 0644
96-
lockTimeout = 30
9795
notInstalledMessage = "Not installed yet and action is uninstall"
9896
defaultMaxHistory = 2
9997
defaultDeletionPropagation = "background"
@@ -183,7 +181,11 @@ func deployHelmCharts(ctx context.Context, c client.Client,
183181
return nil
184182
}
185183

186-
return postProcessDeployedHelmCharts(ctx, clusterSummary, kubeconfig, mgmtResources, logger)
184+
err = postProcessDeployedHelmCharts(ctx, clusterSummary, kubeconfig, mgmtResources, logger)
185+
if err != nil {
186+
logger.V(logs.LogInfo).Error(err, "failed to deploy helmCharts")
187+
}
188+
return err
187189
}
188190

189191
func postProcessDeployedHelmCharts(ctx context.Context, clusterSummary *configv1beta1.ClusterSummary,
@@ -338,7 +340,11 @@ func undeployHelmCharts(ctx context.Context, c client.Client,
338340
}
339341
defer closer()
340342

341-
return undeployHelmChartResources(ctx, c, clusterSummary, kubeconfig, logger)
343+
err = undeployHelmChartResources(ctx, c, clusterSummary, kubeconfig, logger)
344+
if err != nil {
345+
logger.V(logs.LogInfo).Error(err, "failed to undeploy HelmCharts")
346+
}
347+
return err
342348
}
343349

344350
func undeployHelmChartsInPullMode(ctx context.Context, c client.Client, clusterSummary *configv1beta1.ClusterSummary,

controllers/handlers_kustomize.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,12 @@ func deployKustomizeRefs(ctx context.Context, c client.Client,
130130
clusterSummary, logger)
131131

132132
configurationHash, _ := o.HandlerOptions[configurationHash].([]byte)
133-
return processKustomizeDeployment(ctx, remoteRestConfig, clusterSummary, localResourceReports,
133+
err = processKustomizeDeployment(ctx, remoteRestConfig, clusterSummary, localResourceReports,
134134
remoteResourceReports, deployError, isPullMode, configurationHash, logger)
135+
if err != nil {
136+
logger.V(logs.LogInfo).Error(err, "failed to deploy KustomizeRefs")
137+
}
138+
return err
135139
}
136140

137141
func processKustomizeDeployment(ctx context.Context, remoteRestConfig *rest.Config,

controllers/handlers_resources.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ func deployResources(ctx context.Context, c client.Client,
8686
clusterSummary, featureHandler, logger)
8787

8888
configurationHash, _ := o.HandlerOptions[configurationHash].([]byte)
89-
return postProcessDeployedResources(ctx, remoteRestConfig, clusterSummary, localResourceReports,
89+
err = postProcessDeployedResources(ctx, remoteRestConfig, clusterSummary, localResourceReports,
9090
remoteResourceReports, deployError, isPullMode, configurationHash, logger)
91+
if err != nil {
92+
logger.V(logs.LogInfo).Error(err, "failed to deploy PolicyRefs")
93+
}
94+
return err
9195
}
9296

9397
func postProcessDeployedResources(ctx context.Context, remoteRestConfig *rest.Config,

0 commit comments

Comments
 (0)