Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the Reconcile loop is not exitting properly #66

Merged
merged 1 commit into from
May 16, 2024

Conversation

mpryc
Copy link
Collaborator

@mpryc mpryc commented May 14, 2024

Fixes issue #65

Whenever we want to exit with error state from the reconcile loop that is considered final state we should use TerminalError.

Returning standard error will cause Reconcile to requeue.

Testing

  1. Deploy controller without the change
  2. Create NonAdminBackup without proper backupSpec, for example
apiVersion: nac.oadp.openshift.io/v1alpha1
kind: NonAdminBackup
metadata:
  name: example
  namespace: nacproject
spec: {}
  1. Observe controller log. It will show error, however it will re-enter check every few seconds.

With this fix, the point number 3 will not re-enter check every few seconds.

In either scenario proper NonAdminBackup object phase and conditions are correct.

Fixes issue migtools#65

Whenever we want to exit with error state from the reconcile
loop that is considered final state we should use TerminalError.

Returning standard error will cause Reconcile to requeue.

Signed-off-by: Michal Pryc <[email protected]>
@mpryc mpryc self-assigned this May 14, 2024
Copy link

openshift-ci bot commented May 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mpryc, shubham-pampattiwar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mpryc,shubham-pampattiwar]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shubham-pampattiwar
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label May 16, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit e94db9d into migtools:master May 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Merged / Ready for build
Development

Successfully merging this pull request may close these issues.

3 participants