@@ -553,11 +553,7 @@ func getLatestReleaseFromRemoteRepository(ctx context.Context, clusterStack *cso
553553 var clusterStacks clusterstack.ClusterStacks
554554
555555 for _ , release := range releases {
556- clusterStackObject , matches , err := matchesSpec (release , & clusterStack .Spec )
557- if err != nil {
558- return nil , fmt .Errorf ("failed to get match release tag %q with spec of ClusterStack: %w" , release , err )
559- }
560-
556+ clusterStackObject , matches := matchesSpec (release , clusterStack )
561557 if matches {
562558 clusterStacks = append (clusterStacks , clusterStackObject )
563559 }
@@ -626,16 +622,22 @@ func matchesOwnerRef(a *metav1.OwnerReference, clusterStack *csov1alpha1.Cluster
626622 return aGV .Group == clusterStack .GroupVersionKind ().Group && a .Kind == clusterStack .Kind && a .Name == clusterStack .Name
627623}
628624
629- func matchesSpec (str string , spec * csov1alpha1.ClusterStackSpec ) (clusterstack.ClusterStack , bool , error ) {
625+ func matchesSpec (str string , clusterStack * csov1alpha1.ClusterStack ) (clusterstack.ClusterStack , bool ) {
630626 csObject , err := clusterstack .NewFromClusterStackReleaseProperties (str )
631627 if err != nil {
632- return clusterstack.ClusterStack {}, false , fmt .Errorf ("failed to get clusterstack object from string %q: %w" , str , err )
628+ record .Warnf (
629+ clusterStack ,
630+ "FailedToParseClusterStackRelease" ,
631+ "failed to get clusterstack object from string %q: %s" , str , err .Error (),
632+ )
633+
634+ return clusterstack.ClusterStack {}, false
633635 }
634636
635- return csObject , csObject .Version .Channel == spec .Channel &&
636- csObject .KubernetesVersion .StringWithDot () == spec .KubernetesVersion &&
637- csObject .Name == spec .Name &&
638- csObject .Provider == spec . Provider , nil
637+ return csObject , csObject .Version .Channel == clusterStack . Spec .Channel &&
638+ csObject .KubernetesVersion .StringWithDot () == clusterStack . Spec .KubernetesVersion &&
639+ csObject .Name == clusterStack . Spec .Name &&
640+ csObject .Provider == clusterStack . Spec . Provider
639641}
640642
641643func unstructuredSpecEqual (oldObj , newObj map [string ]interface {}) (newSpec map [string ]interface {}, isEqual bool , err error ) {
0 commit comments