-
Notifications
You must be signed in to change notification settings - Fork 5
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
Reconcile loop rework #54
Conversation
need to rebase... |
Moves Status outside of Spec and adjusts this to reflect Velero Backup status as well additional Status when the Spec within NonAdminBackup is not defined. Signed-off-by: Michal Pryc <[email protected]>
Additional improvements to the NonAdminBackup: - Use generic condition names (Accepted, Queued) - Introduce VeleroBackupNamespace - Change Status: OadpVeleroBackup to VeleroBackupName - Use CammelCase for condition reasoan Signed-off-by: Michal Pryc <[email protected]>
Adjust NonAdminCondition and move it to new types, so it can be use as well in NonAdminRestore object. Signed-off-by: Michal Pryc <[email protected]>
e9b0ac1
to
e0a9004
Compare
4799db7
to
d081047
Compare
Rework of the reconcile loop to include batch reconcile. Move assignment of the Log or Context outisde of the reconcile loop. Signed-off-by: Michal Pryc <[email protected]>
d081047
to
476783c
Compare
Small nit to make if statement easier to read. Signed-off-by: Michal Pryc <[email protected]>
Change of the main reconcile loop to easy logic of the return from the reconcile batch. We only requeue when there is need, otherwise we do exit the reconcile loop at the same place and individual reconcile functions control if that should happen now or should be requeued. Signed-off-by: Michal Pryc <[email protected]>
01cad5a
to
f4f4e55
Compare
In this implementation we don't have ReconcileBatch, instead we do have functions with arguments that has appropriate types. Also there was modified implementation to first check for errors and then continue with app flow. Signed-off-by: Michal Pryc <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no "how to test" section in PR description
Added with few different use-cases. |
With this change there is no separate file per reconcile function and we move all the reconcile related functions inside nonadminbackup_controller. Signed-off-by: Michal Pryc <[email protected]>
Did some high level testing, 2 issues that can be addressed separately in follow up PRs: |
[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:
Approvers can indicate their approval by writing |
@mateusoliveira43 is there anything in this PR that requires rework or can we merge and continue with other PRs to improve code base? |
NonAdminBackup reconcile loop major rework
Rework of the reconcile loop to include batch reconcile.
Move assignment of the Log or Context outside of the reconcile loop.
How to test
Note it's best to test this PR together with #56 which includes namespace guard (case d) in this instructions.
All of the below are in the non-admin namespace
nacproject
:a) Case where there is no backupSpec:
Result should be NAB in backingOff phase with
BackupSpec is not defined
condition message:b) Case where there is backupSpec, but empty, should create Velero Backup with nacproject namespace in the includedNamespaces (below is not full spec, removed
managedFields
from it):Result should be created Velero Backup with
includedNamespaces
same as the origin NAB namespace and updated NonAdminBackup (below is not full spec, removedmanagedFields
from it):c) Perform step a) and then update/patch (a) to include empty backupSpec. The reconcile should be same as in b), so the Velero Backup should be created.
d) Create NonAdminBackup with
includedNamespaces
that does not match the namespace from the NonAdminBackup.Result should be NAB in backingOff phase with
spec.backupSpec.IncludedNamespaces can not contain namespaces other then: nacproject
condition message: