-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: do not follower scheduling when dry run #296
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
+ Coverage 31.42% 31.44% +0.02%
==========================================
Files 123 122 -1
Lines 14343 14346 +3
==========================================
+ Hits 4507 4511 +4
+ Misses 9423 9421 -2
- Partials 413 414 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if fedObj.GetAnnotations()[common.EnableFollowerSchedulingAnnotation] != common.AnnotationValueTrue || | ||
fedObj.GetAnnotations()[common.NoSchedulingAnnotation] == common.AnnotationValueTrue || util.SkipSync(fedObj) { |
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.
Is checking the DryRun annotation sufficient? Ideally follower controller shouldn't need to care about the federated object status.
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 it needs. For example, assume the workload have been propagated to member clusters, users added the dry-run anno, at this time, dry run will not work, but because we cut off the relationship of leader and follower, follower will not propagate, this will cause the original workload to not work properly.
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.
Makes sense. But if this is the case, we probably shouldn't have written the dry-run results into placements, as they can easily be misused by other controllers. An annotation would be better. What do you think?
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 have tested several situations, and I think they are relatively stable. Placements now only have three controller: global-scheduler, follower-controller and ns-auto controller. 90% of all cases are global-scheduler. Another point is that we are not yet sure whether this restriction len(fo.status().clusters) == 0
will be removed in the future. This is mainly because there is no such scenario yet. So, I think putting into placement is OK.
9c979e1
to
42e8371
Compare
fedResource.RecordEvent("DryRunWorked", "Dry run worked for %s", fedResource.FederatedName()) | ||
return worker.StatusAllOK | ||
} | ||
fedResource.RecordEvent("DryRunSkipped", "Dry run skipped because resource has been propagated") |
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.
Add an event to prompt the user that dryRun does not take effect.
Signed-off-by: shentiecheng <[email protected]>
42e8371
to
ec4b269
Compare
feat: do not follower scheduling when dry run
No description provided.