Skip to content

Commit

Permalink
log new and old template
Browse files Browse the repository at this point in the history
  • Loading branch information
rkthtrifork committed Aug 27, 2024
1 parent 55c0e75 commit 7e5b010
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opensearch-operator/pkg/reconcilers/indextemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/Opster/opensearch-k8s-operator/opensearch-operator/pkg/reconcilers/k8s"
"github.com/Opster/opensearch-k8s-operator/opensearch-operator/pkg/reconcilers/util"
"github.com/cisco-open/operator-tools/pkg/reconciler"
"github.com/davecgh/go-spew/spew"
"github.com/go-logr/logr"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
Expand Down Expand Up @@ -236,6 +237,8 @@ func (r *IndexTemplateReconciler) Reconcile() (retResult ctrl.Result, retErr err
}

// Return if there are no changes
r.logger.Info(spew.Sdump(existingTemplate))
r.logger.Info(spew.Sdump(newTemplate))
if r.instance.Spec.Name == existingTemplate.Name && cmp.Equal(*newTemplate, existingTemplate.IndexTemplate, cmpopts.EquateEmpty()) {
r.logger.Info("Index template is in sync, no changes needed", "templateName", templateName)
r.recorder.Event(r.instance, "Normal", opensearchAPIUnchanged, "index template is in sync")
Expand Down

0 comments on commit 7e5b010

Please sign in to comment.