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

External changes on several failed updates for all clusters #689

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

ribaraka
Copy link
Contributor

Refactor the codebase by eliminating the UpdateQueuedAnnotation annotation and unnecessary redundancy in handling external changes. This PR enhances code clarity and readability, resulting in a cleaner implementation. Now the operator handles InstAPI Update errors - after several errors, the operator returns external changes and blocks the update operation

@ribaraka ribaraka added enhancement New feature or request refactor Code improvements or refactorings labels Jan 26, 2024
@ribaraka ribaraka self-assigned this Jan 26, 2024
resource.GetAnnotations()[models.ExternalChangesAnnotation] = ""
resource.GetAnnotations()[models.ResourceStateAnnotation] = models.UpdatedEvent

fmt.Println("resource.GetAnnotations()[models.ResourceStateAnnotation] ", resource.GetAnnotations()[models.ResourceStateAnnotation])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete this log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


fmt.Println("resource.GetAnnotations()[models.ResourceStateAnnotation] ", resource.GetAnnotations()[models.ResourceStateAnnotation])

l.Info("External changes have been reconciled", "resource ID", resource.GetClusterID())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think resource ID -> cluster ID is more suitable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@ribaraka ribaraka force-pushed the rimiter branch 3 times, most recently from ef54408 to dacb39d Compare January 26, 2024 13:08
@@ -247,6 +246,12 @@ func (r *ZookeeperReconciler) handleUpdateCluster(
return reconcile.Result{}, err
}

if zook.Annotations[models.ExternalChangesAnnotation] == models.True ||
r.RateLimiter.NumRequeues(req) == rlimiter.DefaultMaxTries ||
!zook.Spec.IsEqual(iZook.Spec) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove !zook.Spec.IsEqual(iZook.Spec) check, cause we checked this case inside the handleExternalChanges func

@testisnullus testisnullus merged commit 60dd2ef into main Jan 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Code improvements or refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants