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

[WIP] 🌱 Use manager and builder pkgs of controller-runtime explicitly. #7175

Conversation

johannesfrey
Copy link
Contributor

@johannesfrey johannesfrey commented Sep 6, 2022

What this PR does / why we need it:

Use manager and builder pkgs of controller-runtime explicitly. Otherwise, controller-runtime will implicitly set the kubeconfig flag to the global command line FlagSet when using the alias types defined in alias.go. See:
https://github.com/kubernetes-sigs/controller-runtime/blob/15b6689c55745514d6bade4c55efb3333c0da4d9/alias.go#L80

The usage of the alias potentially collides with user code that imports the api packages of Cluster API.

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

Johannes Frey <johannes.frey@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH (Provider Information)

Otherwise, controller-runtime will implicitly set the `kubeconfig` flag
to the global command line FlagSet when using the alias types defined in
alias.go. See:
https://github.com/kubernetes-sigs/controller-runtime/blob/15b6689c55745514d6bade4c55efb3333c0da4d9/alias.go#L80

The usage of the alias types potentially collides with user code that
imports the api packages of Cluster API.

Signed-off-by: Johannes Frey <johannes.frey@mercedes-benz.com>
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 6, 2022
@johannesfrey
Copy link
Contributor Author

/hold

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign cecilerobertmichon for approval by writing /assign @cecilerobertmichon in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Sep 6, 2022
@fabriziopandini
Copy link
Member

It would be great to get some feedback about this experiment at the office hours; if this make our APIs easier to consume from other go projects, I'm pretty sure many people will be interested in it

@sbueringer
Copy link
Member

sbueringer commented Sep 19, 2022

Let's see if the controller-runtime PR merges. Then we don't need this change and also don't have to keep it in mind going forward

@fabriziopandini
Copy link
Member

can we link CR PR here or on the issues for better visibility?

@sbueringer
Copy link
Member

Issue: kubernetes-sigs/controller-runtime#1396
PR: kubernetes-sigs/controller-runtime#1999

@johannesfrey Can you edit your post on the CAPI issue where you linked the issue and also mention the PR?

@johannesfrey
Copy link
Contributor Author

Issue: kubernetes-sigs/controller-runtime#1396 PR: kubernetes-sigs/controller-runtime#1999

@johannesfrey Can you edit your post on the CAPI issue where you linked the issue and also mention the PR?

Thx. I updated the issue.

@johannesfrey
Copy link
Contributor Author

Closing because of #7176 (comment)

@johannesfrey johannesfrey deleted the do-not-use-controller-runtime-alias branch November 3, 2022 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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.

Make the v1beta1 api package easier to consume
4 participants