From 57fec04318951fb5b51bf129bfd8ef1fbc599f59 Mon Sep 17 00:00:00 2001 From: raffaelespazzoli Date: Sat, 30 Jan 2021 14:42:44 -0500 Subject: [PATCH] commented some debug logs Signed-off-by: raffaelespazzoli --- pkg/util/lockedresourcecontroller/enforcing-reconciler.go | 2 +- .../lockedresourcecontroller/locked-resource-manager.go | 4 ++-- pkg/util/lockedresourcecontroller/resource-reconciler.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/util/lockedresourcecontroller/enforcing-reconciler.go b/pkg/util/lockedresourcecontroller/enforcing-reconciler.go index 8e0f32d..eccddc6 100644 --- a/pkg/util/lockedresourcecontroller/enforcing-reconciler.go +++ b/pkg/util/lockedresourcecontroller/enforcing-reconciler.go @@ -187,7 +187,7 @@ func (er *EnforcingReconciler) ManageSuccess(context context.Context, instance c LockedPatchStatuses: er.GetLockedPatchStatuses(instance), } enforcingReconcileStatusAware.SetEnforcingReconcileStatus(status) - er.log.V(1).Info("about to modify state for", "instance version", instance.GetResourceVersion()) + //er.log.V(1).Info("about to modify state for", "instance version", instance.GetResourceVersion()) err := er.GetClient().Status().Update(context, instance) if err != nil { if errors.IsResourceExpired(err) { diff --git a/pkg/util/lockedresourcecontroller/locked-resource-manager.go b/pkg/util/lockedresourcecontroller/locked-resource-manager.go index 4bb6bf9..4ed114a 100644 --- a/pkg/util/lockedresourcecontroller/locked-resource-manager.go +++ b/pkg/util/lockedresourcecontroller/locked-resource-manager.go @@ -317,7 +317,7 @@ func (lrm *LockedResourceManager) validateLockedResources(lockedResources []lock schemaValidation := validation.NewSchemaValidation(resources) result := &multierror.Error{} for _, lockedResource := range lockedResources { - lrm.log.V(1).Info("validating", "resource", lockedResource.Unstructured) + //lrm.log.V(1).Info("validating", "resource", lockedResource.Unstructured) resource, err := util.IsUnstructuredDefined(&lockedResource.Unstructured, discoveryClient) if err != nil { lrm.log.Error(err, "unable to validate", "unstructured", lockedResource.Unstructured) @@ -366,7 +366,7 @@ func (lrm *LockedResourceManager) validateLockedPatches(patches []lockedpatch.Lo for _, lockedPatch := range patches { objrefs := append(lockedPatch.SourceObjectRefs, lockedPatch.TargetObjectRef) for _, objref := range objrefs { - lrm.log.V(1).Info("validating", "objref", objref) + //lrm.log.V(1).Info("validating", "objref", objref) resource, err := util.IsGVKDefined(objref.GroupVersionKind(), discoveryClient) if err != nil { lrm.log.Error(err, "unable to validate", "objectref", objref) diff --git a/pkg/util/lockedresourcecontroller/resource-reconciler.go b/pkg/util/lockedresourcecontroller/resource-reconciler.go index a2ce610..1d4a75d 100644 --- a/pkg/util/lockedresourcecontroller/resource-reconciler.go +++ b/pkg/util/lockedresourcecontroller/resource-reconciler.go @@ -137,7 +137,7 @@ func (lor *LockedResourceReconciler) Reconcile(context context.Context, request lor.log.Error(err, "unable to lookup", "object", lor.Resource) return lor.manageError(instance, err) } - lor.log.V(1).Info("determining if resources are equal", "desired", lor.Resource, "current", instance) + //lor.log.V(1).Info("determining if resources are equal", "desired", lor.Resource, "current", instance) equal, err := lor.isEqual(instance) if err != nil { lor.log.Error(err, "unable to determine if", "object", lor.Resource, "is equal to object", instance) @@ -155,7 +155,7 @@ func (lor *LockedResourceReconciler) Reconcile(context context.Context, request lor.log.Error(err, "unable to marshall ", "object", patch) return lor.manageError(instance, err) } - lor.log.V(1).Info("executing", "patch", string(patchBytes), "on object", instance) + //lor.log.V(1).Info("executing", "patch", string(patchBytes), "on object", instance) _, err = client.Patch(context, instance.GetName(), types.MergePatchType, patchBytes, metav1.PatchOptions{}) if err != nil { lor.log.Error(err, "unable to patch ", "object", instance, "with patch", string(patchBytes)) @@ -169,7 +169,7 @@ func (lor *LockedResourceReconciler) Reconcile(context context.Context, request func (lor *LockedResourceReconciler) isEqual(instance *unstructured.Unstructured) (bool, error) { left, err := lockedresource.FilterOutPaths(&lor.Resource, lor.ExcludePaths) - lor.log.V(1).Info("resource", "desired", left) + //lor.log.V(1).Info("resource", "desired", left) if err != nil { return false, err } @@ -177,7 +177,7 @@ func (lor *LockedResourceReconciler) isEqual(instance *unstructured.Unstructured if err != nil { return false, err } - lor.log.V(1).Info("resource", "current", right) + //lor.log.V(1).Info("resource", "current", right) return reflect.DeepEqual(left, right), nil }