@@ -188,7 +188,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req controllerruntime.Reques
188188 Status : metav1 .ConditionFalse ,
189189 Type : string (fleetv1beta1 .ResourceBindingOverridden ),
190190 Reason : condition .OverriddenFailedReason ,
191- Message : fmt . Sprintf ( "Failed to apply the override rules on the resources: %s" , errorMessage ) ,
191+ Message : errorMessage ,
192192 ObservedGeneration : resourceBinding .Generation ,
193193 })
194194 } else {
@@ -624,13 +624,13 @@ func (r *Reconciler) fetchAllResourceSnapshots(ctx context.Context, resourceBind
624624func (r * Reconciler ) getConfigMapEnvelopWorkObj (ctx context.Context , workNamePrefix string , resourceBinding * fleetv1beta1.ClusterResourceBinding ,
625625 resourceSnapshot * fleetv1beta1.ClusterResourceSnapshot , envelopeObj * unstructured.Unstructured , resourceOverrideSnapshotHash , clusterResourceOverrideSnapshotHash string ) (* fleetv1beta1.Work , error ) {
626626 // we group all the resources in one configMap to one work
627- manifest , err := extractResFromConfigMap (envelopeObj )
627+ manifests , err := extractResFromConfigMap (envelopeObj )
628628 if err != nil {
629629 klog .ErrorS (err , "configMap has invalid content" , "snapshot" , klog .KObj (resourceSnapshot ),
630630 "resourceBinding" , klog .KObj (resourceBinding ), "configMapWrapper" , klog .KObj (envelopeObj ))
631631 return nil , controller .NewUserError (err )
632632 }
633- klog .V (2 ).InfoS ("Successfully extract the enveloped resources from the configMap" , "numOfResources" , len (manifest ),
633+ klog .V (2 ).InfoS ("Successfully extract the enveloped resources from the configMap" , "numOfResources" , len (manifests ),
634634 "snapshot" , klog .KObj (resourceSnapshot ), "resourceBinding" , klog .KObj (resourceBinding ), "configMapWrapper" , klog .KObj (envelopeObj ))
635635
636636 // Try to see if we already have a work represent the same enveloped object for this CRP in the same cluster
@@ -643,7 +643,7 @@ func (r *Reconciler) getConfigMapEnvelopWorkObj(ctx context.Context, workNamePre
643643 fleetv1beta1 .EnvelopeNamespaceLabel : envelopeObj .GetNamespace (),
644644 }
645645 workList := & fleetv1beta1.WorkList {}
646- if err : = r .Client .List (ctx , workList , envelopWorkLabelMatcher ); err != nil {
646+ if err = r .Client .List (ctx , workList , envelopWorkLabelMatcher ); err != nil {
647647 return nil , controller .NewAPIServerError (true , err )
648648 }
649649 // we need to create a new work object
@@ -680,7 +680,7 @@ func (r *Reconciler) getConfigMapEnvelopWorkObj(ctx context.Context, workNamePre
680680 },
681681 Spec : fleetv1beta1.WorkSpec {
682682 Workload : fleetv1beta1.WorkloadTemplate {
683- Manifests : manifest ,
683+ Manifests : manifests ,
684684 },
685685 ApplyStrategy : resourceBinding .Spec .ApplyStrategy ,
686686 },
@@ -699,7 +699,7 @@ func (r *Reconciler) getConfigMapEnvelopWorkObj(ctx context.Context, workNamePre
699699 work .Annotations [fleetv1beta1 .ParentResourceSnapshotNameAnnotation ] = resourceBinding .Spec .ResourceSnapshotName
700700 work .Annotations [fleetv1beta1 .ParentResourceOverrideSnapshotHashAnnotation ] = resourceOverrideSnapshotHash
701701 work .Annotations [fleetv1beta1 .ParentClusterResourceOverrideSnapshotHashAnnotation ] = clusterResourceOverrideSnapshotHash
702- work .Spec .Workload .Manifests = manifest
702+ work .Spec .Workload .Manifests = manifests
703703 work .Spec .ApplyStrategy = resourceBinding .Spec .ApplyStrategy
704704 return & work , nil
705705}
0 commit comments