@@ -58,7 +58,7 @@ func reconcileScopeForResource(
58
58
return nil , err
59
59
}
60
60
61
- return newResourceReconcileScope (crs , resourceRef , resourceSetBinding , normalizedData , objs ), nil
61
+ return newResourceReconcileScope (crs , resourceRef , resourceSetBinding , normalizedData , objs )
62
62
}
63
63
64
64
func newResourceReconcileScope (
@@ -67,7 +67,7 @@ func newResourceReconcileScope(
67
67
resourceSetBinding * addonsv1.ResourceSetBinding ,
68
68
normalizedData [][]byte ,
69
69
objs []unstructured.Unstructured ,
70
- ) resourceReconcileScope {
70
+ ) ( resourceReconcileScope , error ) {
71
71
base := baseResourceReconcileScope {
72
72
clusterResourceSet : clusterResourceSet ,
73
73
resourceRef : resourceRef ,
@@ -79,11 +79,11 @@ func newResourceReconcileScope(
79
79
80
80
switch addonsv1 .ClusterResourceSetStrategy (clusterResourceSet .Spec .Strategy ) {
81
81
case addonsv1 .ClusterResourceSetStrategyApplyOnce :
82
- return & reconcileApplyOnceScope {base }
82
+ return & reconcileApplyOnceScope {base }, nil
83
83
case addonsv1 .ClusterResourceSetStrategyReconcile :
84
- return & reconcileStrategyScope {base }
84
+ return & reconcileStrategyScope {base }, nil
85
85
default :
86
- return nil
86
+ return nil , errors . Errorf ( "unsupported or empty resource strategy: %q" , clusterResourceSet . Spec . Strategy )
87
87
}
88
88
}
89
89
@@ -173,7 +173,7 @@ func (r *reconcileApplyOnceScope) applyObj(ctx context.Context, c client.Client,
173
173
174
174
type applyObj func (ctx context.Context , c client.Client , obj * unstructured.Unstructured ) error
175
175
176
- // apply reconciles unstructured objects using applyObj and aggreates the error if present.
176
+ // apply reconciles unstructured objects using applyObj and aggregates the error if present.
177
177
func apply (ctx context.Context , c client.Client , applyObj applyObj , objs []unstructured.Unstructured ) error {
178
178
errList := []error {}
179
179
for i := range objs {
0 commit comments