-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make the v1beta1 api package easier to consume #7176
Comments
I would prefer the first option, i.e. changing the imports. But I wonder if there is a way to resolve the TODO in CR itself so using the top-level package doesn't lead to this problem. Essentially resolving
in CR instead of changing the imports in CAPI. No strong objections against changing the imports in CAPI in the meantime, but it would be more sustainable if it could be fixed in CR instead (not sure who remembers in the future which imports we have to use, and it would be nice to use the aliases for their intended purposes). @vincepri WDYT? |
Thanks for the quick reply. FYI: There have been related issues regarding this in CR:
|
Thx! |
/triage accepted I'm curious to understand if changing imports is enough to improve the situation/simplify the import graph. |
FYI: The CR PR has been merged, which should resolve the issue as soon as CAPI bumps to a version of CR that contains the fix. Some follow-up steps/questions:
|
Thanks for the update! |
Sure 🙂. Ok, if the bump is done regularly I won't open an issue. Thx! |
Sounds good to me. The bump of CR will be mandatory for the Kubernetes 1.26 dependency bump anyway. Both should easily make it into v1.4.0 (given that Kubernetes 1.26 is planned for December and CAPI 1.4 for end of March) |
@johannesfrey Thx for your work on this!! |
User Story
As a user I would like to easily consume the CAPI v1beta1 API package without introducing unwanted transitive dependencies.
Detailed Description
Currently if one imports the CAPI v1beta1 API package, which in turn imports
sigs.k8s.io/controller-runtime
, the user transitively importssigs.k8s.io/controller-runtime/pkg/client/config
, which sets the string varkubeconfig
to the default command line FlagSet. See:In the past this lead to redefined flag panics in our internal code base. A slack discussion revealed two possible solutions in CAPI:
alias.go
and directly depends on the packages itself.Anything else you would like to add:
It's probably most desirable to fix this directly in controller-runtime instead of CAPI and potential providers. Nevertheless, for both mentioned "CAPI solutions" there are corresponding WIP PRs in place. If one is more desirable the other one could be closed.
/kind feature
Johannes Frey <johannes.frey@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH (Provider Information)
The text was updated successfully, but these errors were encountered: