-
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
🐛 Backport clusterctl discovery fix to branch release-1.0 #5718
🐛 Backport clusterctl discovery fix to branch release-1.0 #5718
Conversation
Hi @Rozzii. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/retest |
@Rozzii: Cannot trigger testing until a trusted user reviews the PR and leaves an 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. |
/ok-to-test |
@sbueringer PTAL |
+1 to your comment, otherwise lgtm |
@@ -183,6 +212,20 @@ func (k *proxy) ListResources(labels map[string]string, namespaces ...string) ([ | |||
continue | |||
} | |||
|
|||
// Continue if the resource is an excluded CRD. | |||
gv, err := schema.ParseGroupVersion(resourceGroup.GroupVersion) |
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.
Can you please run gofmt, this indentation is wrong. Not sure why our jobs didn't detect it, but running make lint locally did
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 like GitHub didn't trigger the golangci-lint workflow on this PR (@fabriziopandini @CecileRobertMichon is this something we might have to enable in the repo settings? otherwise it was probably a GitHub flake.
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.
TBH I think this is something we forgot to do when creating this branch
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.
@sbueringer should we change this (not really sure how github actions work on older branch)?
- main |
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.
@fabriziopandini Maybe it just doesn't :). I would suggest changing that to something which matches our release branches too (https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet) and then backporting that change
I think (or more like guess) that GitHub uses the workflow config of the base branch of a PR to decide which workflows should be run.
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.
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.
done
7d2e4c1
to
77416f8
Compare
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.
77416f8
to
487dbb1
Compare
Thx! |
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.
Congrats for your first PR in CAPI @Rozzii 🥳 !
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
This patch was originally introduced in PR #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.