-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove collector package #786
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any of the vendoring changes necessary? It seems like if those are just updated, then we should do that in a separate PR.
Overall looks good. Happy to get rid of that effectively unused package.
@@ -0,0 +1,264 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way we can preserve the history of this one? it's really just a rename right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not just a file rename, it also renames the individual build functions to Store suffix, e.g. buildDaemonSetCollection
-> buildDaemonSetStore
guthub is bad at displaying the diff, but I split it multiple commits, so hopefully, it's easier. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. In that case the diff is probably too large for git to acknowledge, that this might be a rename, so it would have had to happen in two commits. In that case I'm ok with it as is.
I was wondering this as well when I noticed the big diff of added files. I think I ran the |
@brancz Update: the changes in the vendor directly are the result of running |
collector package was an unnecessary wrapper. This replaces the .Collect with a call to Store.WriteAll every time a collect is needed.
Since the removal of collector, this introduces both the concept of the store and the resources instead of collectors that the user passes in. The user facing logs and flags were not changed as that would be a regression.
Interesting. In that case this lgtm. Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brancz, LiliC 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 |
Travis seems to be having some issues with starting the build. 🤷♀ |
What this PR does / why we need it:
Initially, this started because we noticed, while using kube-state-metrics as a library, that there is an unnecessary pointer to an interface. Wanted to remove that pointer, but noticed that the collector package does not need to exist, as it's just a wrapper around store and instead we can just do a call
.WriteAll(w)
on thestore
object directly.The majority of this PR is renaming things from collector -> store.
Note: None of the user-facing code was changed, as that would be a breaking change. So logs, flags that mention collectors stay unchanged. IMHO user-facing "collectors" flag should be renamed to "resources", but like I said that would be a user breaking change.