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

[release-0.14] 🐛 inherited defaults not respected in cache BuilderWithOptions #2491

Conversation

akalenyu
Copy link
Contributor

When using BuilderWithOptions some of the inherited (manager/cluster) options are lost.
If they were provided, they would be stronger than the cache package defaults
(In my case, the default dynamic mapper is overridden with discovery).

From a quick look at 0.15/0.16 this is not an issue there.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 11, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 11, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @akalenyu. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 11, 2023
@akalenyu
Copy link
Contributor Author

/cc @joelanford

@sbueringer
Copy link
Member

sbueringer commented Sep 11, 2023

From a quick look at 0.15/0.16 this is not an issue there.

Is it a problem there or not? If it is we should fix it first on main

Nvm we got rid of this code

@sbueringer
Copy link
Member

/ok-to-test

Fix seems okay to me. Not sure if we are still actively maintaining this branch though (no strong opinions from my side)

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 11, 2023
@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2023
@sbueringer
Copy link
Member

@alvaroaleman WDYT?

@sbueringer
Copy link
Member

/lgtm cancel

Would be good to have some unit test coverage

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2023
@alvaroaleman
Copy link
Member

I'd rather have ppl upgrade controller-runtime tbh

@akalenyu
Copy link
Contributor Author

I'd rather have ppl upgrade controller-runtime tbh

So we have some release branches where we made the decision not to bump
back when the release note came out

A note from the maintainers

The following release is probably the largest in the history of the project. Controller Runtime is a foundational piece for almost all controllers and operators and we're aware that breaking changes are never an ask for our users, especially while running production services.

We take breaking changes very seriously and carefully reviewed each one of these changes to improve the codebase, user experience, and future maintainability of the project.

The v0.15 release is a stepping stone towards maturity.

As always, please reach out in Slack in #controller-runtime.

As far as I can tell based on https://github.com/kubernetes-sigs/controller-runtime/commits/release-0.14
There will be others in the same boat (notice at some point that they're using the wrong mapper)

Would be good to have some unit test coverage

Let me know if you would accept this fix, then I can work on some. Note, like you mention above,
this code is non existent anymore in later branches

@sbueringer
Copy link
Member

sbueringer commented Sep 12, 2023

As far as I can tell based on https://github.com/kubernetes-sigs/controller-runtime/commits/release-0.14
There will be others in the same boat (notice at some point that they're using the wrong mapper)

Can you elaborate, I don't understand what you mean. Are there blockers which prevent you from bumping to 0.16? If yes, I would prefer getting those resolved over maintaining 0.14 indefinitely

Edit: Ah wait, you already bumped on the main branch, but you have older branches with older CR versions that you have to maintain?

@akalenyu
Copy link
Contributor Author

Edit: Ah wait, you already bumped on the main branch, but you have older branches with older CR versions that you have to maintain?

Yup

@sbueringer
Copy link
Member

Alright, sounds fine from my side.

@alvaroaleman Fine for you as well?

akalenyu added a commit to akalenyu/containerized-data-importer that referenced this pull request Sep 12, 2023
Today, controller runtime mistakenly ignores the inherited Manager default
dynamic mapper and uses a discovery mapper instead:
kubernetes-sigs/controller-runtime#2491
This means that if some CRD was not available on the cdi-controller startup,
Even if it got installed after, we would still get IsNoMatch when trying to access it.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
@alvaroaleman
Copy link
Member

yeah okay, fair

When using BuilderWithOptions the inherited (manager/cluster) options
are lost. If they were provided, they are stronger than the cache package defaults.
(Overrides default dynamic mapper in my case)

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
@akalenyu akalenyu force-pushed the cache-respect-inherited-defaults branch from 2b0d261 to f27befe Compare September 13, 2023 12:46
This was referenced Feb 9, 2024
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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants