Skip to content

Commit

Permalink
commented some debug logs
Browse files Browse the repository at this point in the history
Signed-off-by: raffaelespazzoli <[email protected]>
  • Loading branch information
raffaelespazzoli committed Jan 30, 2021
1 parent 74dec1c commit 57fec04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/util/lockedresourcecontroller/enforcing-reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/lockedresourcecontroller/locked-resource-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/lockedresourcecontroller/resource-reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand All @@ -169,15 +169,15 @@ 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
}
right, err := lockedresource.FilterOutPaths(instance, lor.ExcludePaths)
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
}

Expand Down

0 comments on commit 57fec04

Please sign in to comment.