-
Notifications
You must be signed in to change notification settings - Fork 192
CPIConfigController also Enqueue cluster event #3318
CPIConfigController also Enqueue cluster event #3318
Conversation
111fb84
to
93f4e3d
Compare
7d05c22
to
89ae2a4
Compare
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
6f367f1
to
e736d07
Compare
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
Codecov Report
@@ Coverage Diff @@
## main #3318 +/- ##
=======================================
Coverage 46.63% 46.63%
=======================================
Files 281 281
Lines 29654 29654
=======================================
Hits 13828 13828
Misses 14569 14569
Partials 1257 1257
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Not related to this PR, but I think we should only use 1 way either name or ownerreference to match its owner cluster. If 2 configs belong to the same cluster, how should we handle it? |
That's an issue with current design. I created a Jira for it |
f7e72b2
to
0b2ebb4
Compare
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
Cluster Generation A/B Results: |
7deb5d9
to
3beb3f5
Compare
a765d3c
to
50458d5
Compare
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
Error out when the owner cluster of a VSphereCPIConfig is not found Fix logger Resolve conmment Enqueue VSphereCluster intead of Cluster Fix readme for lint Rmove log Fix the cluster type Skip cpiconfig if it's template Add
50458d5
to
975271d
Compare
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.
Looks good, thanks for adding filters for template config in the event handler!
Thanks @HL-EverGreen could you take a look at this simialr PR as well? https://github.com/vmware-tanzu/tanzu-framework/pull/3377/files |
Name: cluster.Name, | ||
UID: cluster.UID, | ||
} | ||
if clusterapiutil.HasOwnerRef(config.OwnerReferences, ownerReference) || config.Name == fmt.Sprintf("%s-%s-package", cluster.Name, constants.CPIAddonName) { |
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 am confused with fmt.Sprintf("%s-%s-package", cluster.Name, constants.CPIAddonName)
as package name and cluster name as package name.
Here we are filtering the cpiConfig to enqueue those who has ownRef to an existing clusters, or who has the "clustername"-"package-prefix"-package name where the cluster is exist.
But in below we only reconcile those who has ownRef to an existing clusters, or who has the name of an existing cluster.
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.
And ALL the AddonConfig test cases are based on cluster name as cpiConfig name
for controller testing. Like
This means after this fix, the user customized AddonConfig which has name of the cluster name will never be enqueued base on the cluster event. But also this cluster name
based reconcile seems useless now, since it will be copied to "cluster name"-"package prefix"-package
for actual use.
The confusion between cluster name as AddonConfig name
and "cluster name"-"package prefix"-package
as AddonConfig name has bring a lot of unsync, I think we really should make this clear.
Per my understanding, the name format of "cluster name"-"package prefix"-package
was never a part of the design doc, yet originally generated based on the copy of the ClusterBootstrapTemplate. All other customized cases are following the cluster name as AddonConfig name. Now this "cluster name"-"package prefix"-package
naming conversion becomes primary, that the Bootstrap Controller will copy both the customized and the default provider configs as this pattern. I think maybe we should eliminate the concept of one of them totally.
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.
We are relying on "cluster name"-"package shortName"-package now. The original design was for "cluster name" but a refactor(I think cloning for webhook) changed it. I would like us to continue down this path of updated name because this has already shipped with vSphere 8.0 integration.
Edit: Docs were updated to reflect this.https://github.com/vmware-tanzu/tanzu-framework/tree/main/addons#pre-create-specific-config-cr
What this PR does / why we need it
VSphereCPIConfigController also relies on underlying Cluster object. The controller should watch on Cluster's event as well
Otherwise, it will cause delay when creating the cluster.
Currently it will just silently exit and might cause 20 minutes delay when creating management cluster, if the VSphereCPIConfig is created before the Cluster object
Which issue(s) this PR fixes
Fixes ##3317
Describe testing done for PR
Enqueue corresponding VSphereCPIConfig when there is Cluster event.
Also error out when VSphereCPIConfig's owner Clusteris not found
Release note
Additional information
Special notes for your reviewer