diff --git a/controllers/topology/desired_state.go b/controllers/topology/desired_state.go index 531b2514dcd2..d78e69a93a4d 100644 --- a/controllers/topology/desired_state.go +++ b/controllers/topology/desired_state.go @@ -93,13 +93,13 @@ func (r *ClusterReconciler) computeDesiredState(ctx context.Context, s *scope.Sc // corresponding template defined in the blueprint. func computeInfrastructureCluster(_ context.Context, s *scope.Scope) (*unstructured.Unstructured, error) { template := s.Blueprint.InfrastructureClusterTemplate - templateClonedFromref := s.Blueprint.ClusterClass.Spec.Infrastructure.Ref + templateClonedFromRef := s.Blueprint.ClusterClass.Spec.Infrastructure.Ref cluster := s.Current.Cluster currentRef := cluster.Spec.InfrastructureRef infrastructureCluster, err := templateToObject(templateToInput{ template: template, - templateClonedFromRef: templateClonedFromref, + templateClonedFromRef: templateClonedFromRef, cluster: cluster, namePrefix: fmt.Sprintf("%s-", cluster.Name), currentObjectRef: currentRef, diff --git a/controllers/topology/internal/extensions/patches/api/interface.go b/controllers/topology/internal/extensions/patches/api/interface.go index f7d536fdb51c..8a50a5e336f0 100644 --- a/controllers/topology/internal/extensions/patches/api/interface.go +++ b/controllers/topology/internal/extensions/patches/api/interface.go @@ -78,7 +78,7 @@ type TemplateRef struct { MachineDeploymentRef MachineDeploymentRef } -func (t *TemplateRef) String() string { +func (t TemplateRef) String() string { ret := fmt.Sprintf("%s %s/%s", t.TemplateType, t.APIVersion, t.Kind) if t.MachineDeploymentRef.TopologyName != "" { ret = fmt.Sprintf("%s, MachineDeployment topology %s", ret, t.MachineDeploymentRef.TopologyName) diff --git a/controllers/topology/internal/extensions/patches/engine.go b/controllers/topology/internal/extensions/patches/engine.go index 58abb46f4390..59fe28fe7fc5 100644 --- a/controllers/topology/internal/extensions/patches/engine.go +++ b/controllers/topology/internal/extensions/patches/engine.go @@ -248,7 +248,7 @@ func applyPatchesToRequest(ctx context.Context, req *api.GenerateRequest, resp * log := tlog.LoggerFrom(ctx) for _, patch := range resp.Items { - log = log.WithValues("templateRef", patch.TemplateRef) + log = log.WithValues("templateRef", patch.TemplateRef.String()) // Get the template the patch should be applied to. template := getTemplate(req, patch.TemplateRef) @@ -264,7 +264,7 @@ func applyPatchesToRequest(ctx context.Context, req *api.GenerateRequest, resp * switch patch.PatchType { case api.JSONPatchType: - log.V(5).Infof("Accumulating JSON patch", "patch", string(patch.Patch.Raw)) + log.V(5).Infof("Accumulating JSON patch: %s", string(patch.Patch.Raw)) jsonPatch, err := jsonpatch.DecodePatch(patch.Patch.Raw) if err != nil { return errors.Wrapf(err, "failed to apply patch to template %s: error decoding json patch (RFC6902): %s", @@ -277,7 +277,7 @@ func applyPatchesToRequest(ctx context.Context, req *api.GenerateRequest, resp * template.TemplateRef, string(patch.Patch.Raw)) } case api.JSONMergePatchType: - log.V(5).Infof("Accumulating JSON merge patch", "patch", string(patch.Patch.Raw)) + log.V(5).Infof("Accumulating JSON merge patch: %s", string(patch.Patch.Raw)) patchedTemplate, err = jsonpatch.MergePatch(template.Template.Raw, patch.Patch.Raw) if err != nil { return errors.Wrapf(err, "failed to apply patch to template %s: error applying json merge patch (RFC7386): %s", diff --git a/controllers/topology/internal/extensions/patches/patch.go b/controllers/topology/internal/extensions/patches/patch.go index 89d266781a2d..51809abc1260 100644 --- a/controllers/topology/internal/extensions/patches/patch.go +++ b/controllers/topology/internal/extensions/patches/patch.go @@ -107,7 +107,7 @@ func patchUnstructured(ctx context.Context, original, modified *unstructured.Uns } // Log the delta between the object before and after applying the accumulated patches. - log.V(4).WithObject(original).Infof("Applying accumulated patches", "diff", string(diff)) + log.V(4).WithObject(original).Infof("Applying accumulated patches to desired state: %s", string(diff)) // Overwrite original. *original = *patched