-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛clusterctl discovery should ignore provider's resources #5684
🐛clusterctl discovery should ignore provider's resources #5684
Conversation
/test pull-cluster-api-e2e-main |
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
/retest |
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.
Overall lgtm, I think
@@ -237,27 +242,26 @@ func (k *proxy) ListResources(labels map[string]string, namespaces ...string) ([ | |||
return nil, errors.Wrap(err, "failed to list api resources") | |||
} | |||
|
|||
// If labels indicates that resources of a specific provider should be listed, exclude CRDs of other providers. | |||
// Exclude from discovery the objects from the cert-manager/provider's CRDs. |
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.
To confirm my understanding.
We're calling this func in two cases:
- certManagerClient.EnsureLatestVersion
- in this case we're not listing any CRDs
- providerComponents.Delete
- in this case we're not listing any provider CRDs, i.e. we still list Certificate and CertificateRequest (which is what we want)
If I'm correct, maybe we should adjust the godocs of the func slightly, as they could also be interpreted differently (i.e. that the func is only not returning resources of the CRDs of the current component)
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.
~ right
In both cases we are not listing resources for any CRDs installed by clusterctl (including cert-manager CRDs and providers CRDs).
In other words, we are only concerned about provider components (deployments, RBAC rules, CRD definitions) but not in the resource created on top of that (Clusters, Machines, AWSCluster etc) because the latter are not relevant for upgrade/delete.
/lgtm |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
/cherry-pick release-1.0 |
@fabriziopandini: #5684 failed to apply on top of branch "release-1.0":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) Reason for backporting: This issue that was solved in db5b183 on the main branch is also effecting older releases of CAPI currently in use thus the patch is applicable on older branches.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) Reason for backporting: This issue that was solved in db5b183 on the main branch is also effecting older releases of CAPI currently in use thus the patch is applicable on older branches.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issue faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issues faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issues faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issue faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issue faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issues faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
This patch was originally introduced in PR kubernetes-sigs#5684. Original name: "clusterctl discovery should ignore provider's resources" Original commit id: db5b183 Original description: While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component. This commit makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself. This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors) This commit also introduces some logic originally implemented in commit f5a9d76 that implements the ability to skip excluded CRD during resource listing. Reason for backporting: The issues that were solved by commit db5b183 and f5a9d76 on the main branch are also effecting older releases of CAPI currently in use thus backporting the "discovery fix" and some related code from f5a9d76 would solve a lot of issues faced by users e.g related to upgrade process as mentioned in the original db5b183 commit.
What this PR does / why we need it:
While managing components (for cert-manager or providers) clusterctl implements a discovery function to seek for all the objects part of the component.
This PR makes this code to ignore resources for a provider (e.g Cluster for CAPI, AWSCluster for CAPA, Certificates for cert-manager) given that those resources are not part of the component itself.
This will make operations like upgrade plan or apply and delete resilient to actual state of cert-manager web hooks; in fact, those operations can now work when web-hooks are not functioning (due to provider's deployment already deleted, to provider scaled down to 0, to other errors)