Skip to content
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

✨ Integrate CRS code into regular code structure #11943

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

mcbenjemaa
Copy link
Member

What this PR does / why we need it:

This PR moves the CRS code from addons to regular CAPI including api and controllers.
Ref: #11114 (comment)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Closes #11114

/area clusterresourceset

/cc @fabriziopandini sbueringer

@k8s-ci-robot k8s-ci-robot added area/clusterresourceset Issues or PRs related to clusterresourcesets cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 8, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 9, 2025
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2025
@mcbenjemaa
Copy link
Member Author

I'm getting many lint issues with:

addons/v1beta1/clusterresourcesetbinding_types.go:192:2: maxlength: field Bindings must have a maximum items, add kubebuilder:validation:MaxItems marker (kal)
        Bindings []*ResourceSetBinding `json:"bindings,omitempty"`
        ^
api/addons/v1beta1/clusterresourcesetbinding_types.go:197:2: maxlength: field ClusterName must have a maximum length, add kubebuilder:validation:MaxLength marker (kal)
        ClusterName string `json:"clusterName,omitempty"`
        ^
api/addons/v1beta1/clusterresourcesetbinding_types.go:211:2: maxlength: field Items must have a maximum items, add kubebuilder:validation:MaxItems marker (kal)

can i disable this?

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 11, 2025
@sbueringer
Copy link
Member

@mcbenjemaa In general yes by changing excludes. But I should have them fixed until tomorrow on main. So I would just ignore them for now and then rebase

@sbueringer
Copy link
Member

sbueringer commented Mar 11, 2025

#11909 is merged
I'll try to get #11949 merged tomorrow during the day

Afterwards there should be no other PRs conflicting with this PR. But I think if you have time already we can already try to get this PR into a state where tests and e2e tests are green (as I mentioned linter can be ignored for now, I would take another look after both other PRs are merged)

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 11, 2025
@mcbenjemaa
Copy link
Member Author

How, we can fix pull-cluster-api-apidiff-main

@sbueringer
Copy link
Member

sbueringer commented Mar 12, 2025

How, we can fix pull-cluster-api-apidiff-main

Doesn't have to be fixed. apidiff just shows the API differences. It's then up to maintainers to determine if the changes are intended / acceptable. At a first glance it looks like they are, but I'll double check when I review the PR itself

These two are much more important:

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 12, 2025
@mcbenjemaa
Copy link
Member Author

I will ignore all kal related lints for now.

@sbueringer
Copy link
Member

@mcbenjemaa Started the CAPI controller locally with tilt. It doesn't come up because of this error

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x4020954390 stack=[0x4020954000, 0x4040954000]

** execution is paused because your program is panicking **
To continue the execution please connect your client to the debugger.
Stack trace:
 0  0x0000000000087a60 in runtime.throw
    at /Users/buringerst/code/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:1058
 1  0x000000000006add8 in runtime.newstack
    at /Users/buringerst/code/pkg/mod/golang.org/[email protected]/src/runtime/stack.go:1117
 2  0x0000000002463cec in sigs.k8s.io/cluster-api/webhooks.(*ClusterResourceSet).SetupWebhookWithManager
    at /Users/buringerst/code/src/sigs.k8s.io/cluster-api/webhooks/alias.go:117
 3  0x0000000002463cbc in sigs.k8s.io/cluster-api/webhooks.(*ClusterResourceSet).SetupWebhookWithManager
    at /Users/buringerst/code/src/sigs.k8s.io/cluster-api/webhooks/alias.go:118
 4  0x0000000002463cbc in sigs.k8s.io/cluster-api/webhooks.(*ClusterResourceSet).SetupWebhookWithManager
    at /Users/buringerst/code/src/sigs.k8s.io/cluster-api/webhooks/alias.go:118
...

Basically the SetupWebhookWithManager funcs in alias.go are calling themselves. They should call the corresonding SetupWebhookWithManager func's in the internal/webhooks package instead

@mcbenjemaa
Copy link
Member Author

Regarding pull-cluster-api-e2e-blocking-main

I tested in my local machine, but I'm getting another error.
the error in the CI, seems to be related to the capi controller manager not running.

@mcbenjemaa
Copy link
Member Author

@mcbenjemaa Started the CAPI controller locally with tilt. It doesn't come up because of this error

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x4020954390 stack=[0x4020954000, 0x4040954000]

** execution is paused because your program is panicking **
To continue the execution please connect your client to the debugger.
Stack trace:
 0  0x0000000000087a60 in runtime.throw
    at /Users/buringerst/code/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:1058
 1  0x000000000006add8 in runtime.newstack
    at /Users/buringerst/code/pkg/mod/golang.org/[email protected]/src/runtime/stack.go:1117
 2  0x0000000002463cec in sigs.k8s.io/cluster-api/webhooks.(*ClusterResourceSet).SetupWebhookWithManager
    at /Users/buringerst/code/src/sigs.k8s.io/cluster-api/webhooks/alias.go:117
 3  0x0000000002463cbc in sigs.k8s.io/cluster-api/webhooks.(*ClusterResourceSet).SetupWebhookWithManager
    at /Users/buringerst/code/src/sigs.k8s.io/cluster-api/webhooks/alias.go:118
 4  0x0000000002463cbc in sigs.k8s.io/cluster-api/webhooks.(*ClusterResourceSet).SetupWebhookWithManager
    at /Users/buringerst/code/src/sigs.k8s.io/cluster-api/webhooks/alias.go:118
...

Basically the SetupWebhookWithManager funcs in alias.go are calling themselves. They should call the corresonding SetupWebhookWithManager func's in the internal/webhooks package instead

You are right 😄

@mcbenjemaa
Copy link
Member Author

what's wrong with netlify
deploy/netlify

@sbueringer
Copy link
Member

Not sure. But I would just ignore Netlify. Usually it always works but once in a month it fails with something. In this case

4:35:31 PM: mise [email protected]   download cpython-3.13.2+20250311-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
4:35:31 PM: mise ERROR failed to install core:[email protected]
4:35:31 PM: mise ERROR HTTP status server error (500 Internal Server Error) for url (https://github.com/astral-sh/python-build-standalone/releases/download/20250311/cpython-3.13.2+20250311-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz)

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick review. I think these findings should fix the test failures as well

@sbueringer
Copy link
Member

sbueringer commented Mar 12, 2025

@mcbenjemaa #11949 merged. Let's rebase on top of main. I think that was the last PR that had conflict potential

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 12, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 13, 2025
@mcbenjemaa
Copy link
Member Author

@sbueringer thanks for your notes.

@sbueringer
Copy link
Member

@mcbenjemaa Btw feel free to squash

@sbueringer
Copy link
Member

Regarding the findings here: https://github.com/kubernetes-sigs/cluster-api/actions/runs/13833818179/job/38704018628?pr=11943

You can simply add the api/addons/v1beta1 path to the existing exclude:

- path: "api/v1beta1/*|api/v1alpha1/*"

@sbueringer
Copy link
Member

sbueringer commented Mar 13, 2025

/test pull-cluster-api-test-main

I think this one is an unrelated flake

So unit tests seems to be fine, but I think we'll need the linter fixes to get everything green (especially e2e tests)

(expectation is that we should be able to get the linter green now with some fixes + #11943 (comment))

Refactor: MOVE CRS to his own addons group

Fix go licenses

Fix webhook alias SetupWebhookWithManager call

Fix envtest, add addonsv1 scheme

Fix Test_* with no addonsv1 scheme

Fix APIGroup for addonsv1

Address reviews and fix missing imports

Generate API

Fix CRS controllers call
@k8s-ci-robot
Copy link
Contributor

@mcbenjemaa: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main 912fd81 link false /test pull-cluster-api-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

@mcbenjemaa
Copy link
Member Author

Should be ready.

@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member

Thank you very much!

/lgtm
/approve

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 13, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 13, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f1dc68474ccd10e890bb013c755503a7679a2ab0

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 13, 2025
@k8s-ci-robot k8s-ci-robot merged commit 01bc3b5 into kubernetes-sigs:main Mar 13, 2025
19 of 20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Mar 13, 2025
@sbueringer
Copy link
Member

@mcbenjemaa Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/clusterresourceset Issues or PRs related to clusterresourcesets cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: ClusterResourceSet
5 participants