-
Notifications
You must be signed in to change notification settings - Fork 68
✨ Watch instead of loop check nested cluster #200
Conversation
main.go
Outdated
@@ -149,7 +150,7 @@ func main() { | |||
Client: mgr.GetClient(), | |||
Log: ctrl.Log.WithName("controllers").WithName("infrastructure").WithName("NestedCluster"), | |||
Scheme: mgr.GetScheme(), | |||
}).SetupWithManager(mgr); err != nil { | |||
}).SetupWithManager(ctx, mgr, concurrency(10)); err != nil { |
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.
Do you think we can make the concurrency
configurable (through the command-line option) ?
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 agree, I think we should have this configurable. We can take the cluster-concurrency
flag from CAPI - https://github.com/kubernetes-sigs/cluster-api/blob/master/main.go#L125-L126
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 added a todo here actually in concurreny implemention function ..
will see how we can add this
newCluster.Status = infrav1.NestedClusterStatus{} | ||
oldCluster.ObjectMeta.ResourceVersion = "" | ||
newCluster.ObjectMeta.ResourceVersion = "" | ||
return !reflect.DeepEqual(oldCluster, newCluster) |
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 is OK for now since there is only one field (Ready
) in the NestedCluster.Status
. @christopherhein what's your opinion?
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 this is fine, cause we don't really need to rereconcile after we set Ready
.
with workaround from #201 at least I can create a nested cluster follow the dev guide with the new PR.. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christopherhein, jichenjc 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 |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #137