-
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
fix: Update NAB status phase and condition together #86
fix: Update NAB status phase and condition together #86
Conversation
Skipping CI for Draft Pull Request. |
if !checkAnnotationValueIsValid(annotations, constant.NabOriginNameAnnotation) { | ||
return false | ||
} | ||
// TODO what is a valid uuid? |
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.
should I have a different validation here? (from what we talked today, this is field will be removed, right? To add one ourselves)
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.
It needs to be updated, not removed, created an issue for this #89
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.
I think we can use go https://github.com/google/uuid to generate UUID ourselves.
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.
yes or another option would be https://github.com/satori/go.uuid
But Google one seems like its more maintained.
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.
@shubham-pampattiwar the satori one was last updated 6 years ago with ~37K uses, so I think it's better stick to something more active. google/uuid was updated 2 weeks ago so it's much more active project with ~320K uses.
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.
yes certainly, google/uuid is the way to go.
Signed-off-by: Mateus Oliveira <[email protected]>
1d75275
to
f5e9c6b
Compare
@@ -125,9 +127,9 @@ func GenerateVeleroBackupName(namespace, nabName string) string { | |||
veleroBackupName := fmt.Sprintf("%s-%s-%s", constant.VeleroBackupNamePrefix, namespace, nameHash) | |||
|
|||
// Ensure the name is within the character limit | |||
if len(veleroBackupName) > constant.MaxKubernetesNameLength { | |||
if len(veleroBackupName) > validation.DNS1123SubdomainMaxLength { |
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.
I like this change.
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.
+1
Signed-off-by: Mateus Oliveira <[email protected]>
@@ -125,9 +127,9 @@ func GenerateVeleroBackupName(namespace, nabName string) string { | |||
veleroBackupName := fmt.Sprintf("%s-%s-%s", constant.VeleroBackupNamePrefix, namespace, nameHash) | |||
|
|||
// Ensure the name is within the character limit | |||
if len(veleroBackupName) > constant.MaxKubernetesNameLength { | |||
if len(veleroBackupName) > validation.DNS1123SubdomainMaxLength { |
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.
+1
Signed-off-by: Mateus Oliveira <[email protected]>
I tried creating a NAB backup using this PR and found some discrepancy in NAB status, it is showing phase as
|
@shubham-pampattiwar this is expected per design https://github.com/migtools/oadp-non-admin/blob/master/docs/design/nab_status_update.md#phase we only have 3 phases, created is the last one. We can change that |
@mateusoliveira43 yeah correct, On one hand |
We have the On the other hand we could also think about 4th phase in NAB that will be |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mateusoliveira43, 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 |
Why the changes were made
As discussed with the team, we want to do less reconcile steps for NAB full reconcile loop (but keeping only making one update call per reconcile). With this PR, NAB reconcile update phases and conditions together in one update call.
Also, simplified Predicate and Handlers logic.
How to test the changes made
Run tests and check logs (
make simulation-test
) or test in a cluster following development documentation.