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

Cleanup of runtime.Object and meta.Accessor #3476

Merged
merged 4 commits into from Feb 1, 2021

Conversation

timebertt
Copy link
Member

How to categorize this PR?

/kind cleanup
/priority normal

What this PR does / why we need it:

With controller-runtime@v0.7 there are client.Object and client.ObjectList to distinguish between single API objects and object lists.
c-r has replaced their usage of runtime.Object (which is more generic) by those two interfaces to have a clearer func/interface contract of what implementations expect from passed objects.

I followed up on this and cleaned up our usage of runtime.Object as well and replaced it with client.{Object,ObjectList} wherever applicable.
Though, there are still a lot of runtime.Object usages left, e.g. in API and registry packages, which have to comply with other interfaces expecting runtime.Object.
Also some of our helper funcs are generic and accept a single object as well as an object list, so for those cases runtime.Object is also still needed.
I think I cut it down to the bare minimum now.

I also cleaned up some unnecessary usages of meta.Accessor in favor of client.Object where it is helpful and makes code a bit slimmer.

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

Special notes for your reviewer:
/squash

Release note:

Some helper functions and interface types have been changed to accept `client.{Object,ObjectList}` instead of `runtime.Object` where applicable to have a clearer contract of what is expected from passed parameters.

@timebertt timebertt requested a review from a team as a code owner January 29, 2021 11:08
@gardener-robot gardener-robot added kind/api-change API change with impact on API users needs/second-opinion 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. labels Jan 29, 2021
@rfranzke
Copy link
Member

❤️ all these cleanup PRs!

rfranzke
rfranzke previously approved these changes Jan 29, 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.

/lgtm

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

/squash

@timebertt timebertt merged commit 076ee66 into gardener:master Feb 1, 2021
@timebertt timebertt deleted the cleanup/meta-accessor branch February 1, 2021 07:39
ezeeyahoo pushed a commit to ezeeyahoo/gardener that referenced this pull request Feb 17, 2021
@gardener-robot gardener-robot added priority/3 Priority (lower number equals higher priority) and removed priority/3 Priority (lower number equals higher priority) labels Mar 8, 2021
krgostev pushed a commit to krgostev/gardener that referenced this pull request Apr 21, 2022
krgostev pushed a commit to krgostev/gardener that referenced this pull request Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change API change with impact on API users 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

6 participants