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

✨ revert injection deprecation logging until internal injection code use stops #1382

Merged
merged 1 commit into from Feb 11, 2021

Conversation

estroz
Copy link
Contributor

@estroz estroz commented Feb 11, 2021

#1322 adds a bunch of logs to injection functions, which are used heavily by the manager and controller builder and therefore unavoidably print for users who aren't using injection code themselves. Until internal usage is stopped, these logs should be removed and static deprecation notices solely used.

Signed-off-by: Eric Stroczynski ericstroczynski@gmail.com

…code

Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 11, 2021
@estroz
Copy link
Contributor Author

estroz commented Feb 11, 2021

@k8s-ci-robot
Copy link
Contributor

@estroz: GitHub didn't allow me to request PR reviews from the following users: varshaprasad96.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @varshaprasad96 @vincepri @alvaroaleman

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 Feb 11, 2021
@estroz estroz changed the title ✨ revert #1322 until comprehensive removal of injection code ✨ revert injection deprecation logging until comprehensive removal of internal injection code use Feb 11, 2021
@estroz estroz changed the title ✨ revert injection deprecation logging until comprehensive removal of internal injection code use ✨ revert injection deprecation logging until internal injection code use stops Feb 11, 2021
@coderanger
Copy link
Contributor

Maybe offer an env var to turn them on? I'm very worried this deprecation is going to catch a lot of people unawares and I think we need to handle it better.

@estroz
Copy link
Contributor Author

estroz commented Feb 11, 2021

Maybe offer an env var to turn them on? I'm very worried this deprecation is going to catch a lot of people unawares and I think we need to handle it better.

The way I see it, as long as injection semantics are still around then no one will be the wiser or they'll have ample time to migrate to some other API. There are 2 categories of use for injection code:

  1. Users directly vendoring the injection library
  2. Code internal to controller-runtime

Category 1 will get static linter warnings when using deprecated code, so they should be notified already of the deprecation. Category 2 will not and only see runtime warnings via the logs this PR is removing; however I don't think users in category 2 will be affected as long as controller-runtime can somehow inject fields into a manager, controller, or cluster post-construction, or be refactored to not need injection. I'm not saying I know what either of these things look like, but I doubt that injection semantics will go away completely given the complexity of the dependency chain of a manager and its constituents.

I could be convinced of a need for an internal-only env variable for controller-runtime testing so this kind of issue doesn't crop up again (discussed in #1322), but this can only be added alongside a new API or refactor.

@coderanger
Copy link
Contributor

I was unable to get linter warnings for this situation to work. The user is not calling anything, they are just declaring some methods. And yes, I didn't realize there was still usage inside controller-runtime, that should be removed ASAP.

@alvaroaleman
Copy link
Member

/lgtm
/assign vincepri

I think we should keep the code for two releases after we removed all internal usages of this and re-added the logging though.

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

Should we target v0.8 for this change, rather than v0.9 (main branch)? We should probably remove the internal usage within 0.9, if we still want to remove it by 0.10

@alvaroaleman
Copy link
Member

I would vote for disabling it in both and only enable after c-r doesn't use this anymore

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: estroz, vincepri

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 Feb 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit e1a725d into kubernetes-sigs:master Feb 11, 2021
@estroz estroz deleted the revert/1322 branch February 11, 2021 16:58
@estroz
Copy link
Contributor Author

estroz commented Feb 11, 2021

I was unable to get linter warnings for this situation to work

@coderanger for some reason neither can I, and I'm 100% sure golangci-lint used to do this. I'm not sure if its golangci-lint version, but the staticcheck linter, which warns of deprecations, isn't running at all.

@alvaroaleman
Copy link
Member

I doubt you can get linter warnings for implementing a deprecated interface, no one is directly calling the injector methods, that is the whole PITA about it

@coderanger
Copy link
Contributor

Yep, that's my worry :) Because this is basically a "reverse function call", it will silently change behavior when the injector code is removed.

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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants