Skip to content

Commit

Permalink
Add retry for opensearch client creation in ISM Policy reconciler (op…
Browse files Browse the repository at this point in the history
…ensearch-project#805)

### Description
Add retry for opensearch client creation in ISM policy reconciler to fix
panic
Minor change - Remove extra whitespace in developing.md file

### Issues Resolved
Resolves
opensearch-project#801

### Check List
- [x] Commits are signed per the DCO using --signoff
- [ ] Unittest added for the new/changed functionality and all unit
tests are successful
- [ ] Customer-visible features documented
- [x] No linter warnings (`make lint`)

If CRDs are changed:
- [ ] CRD YAMLs updated (`make manifests`) and also copied into the helm
chart
- [ ] Changes to CRDs documented

Please refer to the [PR
guidelines](https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/docs/developing.md#submitting-a-pr)
before submitting this pull request.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Nilushan Costa <[email protected]>
(cherry picked from commit ea46394)
  • Loading branch information
nilushancosta authored and swoehrl-mw committed Jul 2, 2024
1 parent 6add733 commit c19dada
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ All PRs must conform to the following rules:
* If you make changes to the CRD the CRD YAMLs must be updated (via `make manifests`) and also copied into the helm chart:

```bash
cp opensearch-operator/config/crd/bases/opensearch.opster.io_*.yaml charts/opensearch-operator/files/
cp opensearch-operator/config/crd/bases/opensearch.opster.io_*.yaml charts/opensearch-operator/files/
```

* Changes to the CRD must be documented in the [CRD reference](./designs/crd.md)
Expand Down
6 changes: 6 additions & 0 deletions opensearch-operator/pkg/reconcilers/ismpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ func (r *IsmPolicyReconciler) Reconcile() (retResult ctrl.Result, retErr error)
if err != nil {
reason := "error creating opensearch client"
r.recorder.Event(r.instance, "Warning", opensearchError, reason)
retResult = ctrl.Result{
Requeue: true,
RequeueAfter: 30 * time.Second,
}
retErr = err
return
}

// If PolicyID not provided explicitly, use metadata.name by default
Expand Down

0 comments on commit c19dada

Please sign in to comment.