@@ -151,6 +151,20 @@ func (r *ClusterStackReleaseReconciler) Reconcile(ctx context.Context, req recon
151
151
return reconcile.Result {Requeue : true }, nil
152
152
}
153
153
154
+ // Check for helm charts in the release assets. If they are not present, then something went wrong.
155
+ if err := releaseAssets .CheckHelmCharts (); err != nil {
156
+ msg := fmt .Sprintf ("failed to validate helm charts: %s" , err .Error ())
157
+ conditions .MarkFalse (
158
+ clusterStackRelease ,
159
+ csov1alpha1 .ClusterStackReleaseAssetsReadyCondition ,
160
+ csov1alpha1 .IssueWithReleaseAssetsReason ,
161
+ clusterv1 .ConditionSeverityError ,
162
+ "%s" , msg ,
163
+ )
164
+ record .Warn (clusterStackRelease , "ValidateHelmChartFailed" , msg )
165
+ return reconcile.Result {}, nil
166
+ }
167
+
154
168
conditions .MarkTrue (clusterStackRelease , csov1alpha1 .ClusterStackReleaseAssetsReadyCondition )
155
169
156
170
kubeClient := r .KubeClientFactory .NewClient (req .Namespace , r .RESTConfig )
@@ -304,7 +318,10 @@ func (r *ClusterStackReleaseReconciler) templateAndApply(ctx context.Context, re
304
318
305
319
// templateClusterClassHelmChart templates the clusterClass helm chart.
306
320
func (* ClusterStackReleaseReconciler ) templateClusterClassHelmChart (releaseAssets * release.Release , name , namespace string ) ([]byte , error ) {
307
- clusterClassChart := releaseAssets .ClusterClassChartPath ()
321
+ clusterClassChart , e := releaseAssets .ClusterClassChartPath ()
322
+ if e != nil {
323
+ return nil , fmt .Errorf ("failed to template clusterClass helm chart: %w" , e )
324
+ }
308
325
309
326
splittedName := strings .Split (name , clusterstack .Separator )
310
327
releaseName := strings .Join (splittedName [0 :4 ], clusterstack .Separator )
0 commit comments