Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rkthtrifork committed Jun 14, 2024
1 parent 8e70ba9 commit 87d6939
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opensearch-operator/pkg/reconcilers/ismpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (r *IsmPolicyReconciler) Reconcile() (retResult ctrl.Result, retErr error)
}

existingPolicy, err := services.GetPolicy(r.ctx, r.osClient, policyId)
r.logger.Info("rkth policy id 1: " + policyId)
// If not exists, create
if errors.Is(err, services.ErrNotFound) {
if err != nil {
Expand All @@ -191,6 +192,7 @@ func (r *IsmPolicyReconciler) Reconcile() (retResult ctrl.Result, retErr error)
}, nil
}

r.logger.Info("rkth policy id 2: " + policyId)
// If some other error
if err != nil {
reason = "failed to get policy from Opensearch API"
Expand All @@ -199,12 +201,14 @@ func (r *IsmPolicyReconciler) Reconcile() (retResult ctrl.Result, retErr error)
return
}

r.logger.Info("rkth policy id 3: " + policyId)
// Return if there are no changes
if r.instance.Spec.PolicyID == existingPolicy.PolicyID && cmp.Equal(newPolicy, existingPolicy.Policy, cmpopts.EquateEmpty()) {
reason = opensearchIsmPolicyExists
return
}

r.logger.Info("rkth policy id 4: " + policyId)
request := requests.ISMPolicy{
Policy: *newPolicy,
}
Expand Down

0 comments on commit 87d6939

Please sign in to comment.