-
Notifications
You must be signed in to change notification settings - Fork 3
Support for dynamic watch lws CRD #12
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
Support for dynamic watch lws CRD #12
Conversation
role.Workload.Kind == getLwsGVK().Kind && !lwsExist { | ||
watchedWorkload.LoadOrStore(reconciler.LwsCrdName, struct{}{}) | ||
runtimeController.Owns(&lwsv1.LeaderWorkerSet{}, builder.WithPredicates(WorkloadPredicate())) | ||
logger.Info("rbc controller watch LeaderWorkerSet CRD") |
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.
rbc -> rbgs
@@ -94,6 +104,14 @@ func (r *RoleBasedGroupReconciler) Reconcile(ctx context.Context, req ctrl.Reque | |||
var roleStatuses []workloadsv1alpha1.RoleStatus | |||
var updateStatus bool | |||
for _, role := range sortedRoles { | |||
// first check whether watch lws cr | |||
_, lwsExist := watchedWorkload.Load(reconciler.LwsCrdName) |
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 suggest encapsulating the logic into a function to enhance reusability and clarity. And it can support Openkruise
type in future.
36cb02b
to
5ab548d
Compare
Signed-off-by: liheng.zms <[email protected]>
5ab548d
to
d580404
Compare
/approve |
No description provided.