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

Drop unused generated clients #4592

Merged
merged 10 commits into from Sep 2, 2021

Conversation

timebertt
Copy link
Member

@timebertt timebertt commented Sep 1, 2021

How to categorize this PR?

/area scalability dev-productivity
/kind cleanup

What this PR does / why we need it:

This PR drops some unused generated client code (extensions and operations group).
It also drops some unused clients (Garden{Core,SeedManagement,Operations} and API{Registration,Extension}) from kubernetes.Interface.

All of this is dropped in favor of (cached) controller-runtime clients to simplify/unify our code and leverage the clients' caches wherever possible.

Which issue(s) this PR fixes:
Part of #2414

Special notes for your reviewer:

kubernetes.Interface.Kubernetes() is not dropped in this PR, as there are still a lot of usages.
This can be tackled in a future PR.

The generated operations clients might be needed in the future, when we add some checks in admission plugins (e.g. for Bastions). I decided to drop them nevertheless for the sake of simplification. We can still add them back with a few lines later on if needed.

Release note:


@timebertt timebertt requested review from a team as code owners September 1, 2021 14:11
@gardener-robot gardener-robot added area/dev-productivity Developer productivity related (how to improve development) area/scalability Scalability related kind/cleanup Something that is not needed anymore and can be cleaned up needs/review size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 1, 2021
Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

Love it! I assume you plan to remove the other clients with subsequent PRs?

pkg/utils/kubernetes/managedseed.go Show resolved Hide resolved
@timebertt
Copy link
Member Author

I assume you plan to remove the other clients with subsequent PRs?

That won't be possible so easily, as they are used in admission plugins.
Currently, I'm not sure, if or how we can switch to controller-runtime clients there (tracked in #2414).

However, what is possible and planned is to remove usages of kubernetes.Interface.Kubernetes() (in all gcm/gardenlet code).

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

/lgtm

@timebertt timebertt mentioned this pull request Sep 1, 2021
16 tasks
@rfranzke
Copy link
Member

rfranzke commented Sep 1, 2021

/squash

@timebertt timebertt merged commit a66d35e into gardener:master Sep 2, 2021
@timebertt timebertt deleted the cleanup/drop-generated-clients branch September 2, 2021 06:24
krgostev pushed a commit to krgostev/gardener that referenced this pull request Apr 21, 2022
* Add AddToScheme to all install packages

The funcs add all versioned API types (i.e., all but internal types).
They can be used as an replacement for the AddToScheme funcs generated
by client-gen.

* Replace usages of generated schemes

* Drop generated extensions client

* Remove usages of generated operations client

* Drop generated operations client

* Drop unused API{Registration,Extension} from kubernetes.Interface

* [generated] make revendor

* Replace usages of kubernetes.Interface.GardenSeedManagement()

* Drop unused Garden{Core,SeedManagement} from kubernetes.Interface

* Drop unused ForwardPodPort from kubernetes.Interface
krgostev pushed a commit to krgostev/gardener that referenced this pull request Jul 5, 2022
* Add AddToScheme to all install packages

The funcs add all versioned API types (i.e., all but internal types).
They can be used as an replacement for the AddToScheme funcs generated
by client-gen.

* Replace usages of generated schemes

* Drop generated extensions client

* Remove usages of generated operations client

* Drop generated operations client

* Drop unused API{Registration,Extension} from kubernetes.Interface

* [generated] make revendor

* Replace usages of kubernetes.Interface.GardenSeedManagement()

* Drop unused Garden{Core,SeedManagement} from kubernetes.Interface

* Drop unused ForwardPodPort from kubernetes.Interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev-productivity Developer productivity related (how to improve development) area/scalability Scalability related kind/cleanup Something that is not needed anymore and can be cleaned up 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.

None yet

5 participants