-
Notifications
You must be signed in to change notification settings - Fork 450
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
Introduce ability to specify strategies for target allocation #1079
Introduce ability to specify strategies for target allocation #1079
Conversation
@@ -0,0 +1,91 @@ | |||
package strategy |
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.
I think we should move the code in the strategy
package back to allocation
. CollectorJSON
is only used in allocation/http.go
and the other JSON structs are also around specifically for the http responses. It would also make naming make more sense (allocation.New()
instead of strategy.New()
). It feels like we're splitting up code that we don't really need to split up. I think that separating the code in this way makes it a little more difficult to navigate and figure out what's going on.
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.
I agree, i think a flat strategy here makes more sense for this codebase as it allows us to only export what's necessary
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.
Looks great! I left a few minor comments relating to imports and comments.
…nto pluggable-strategies-take-two
…elemetry#1079) * Cribbed from another branch * Refactor part 2 * Fix tests * Remove deadlocking problem * Update based on comments * Unexported some fields, added blocker and comments about invariants * Comments and imports fixed
Following from #1068 ...
Goals:
Summary
This PR introduces the Allocator interface, implements it through a refactor of the current allocator, and changes the configuration of the TA to allow for a user to specify an option. The operator's CRDs are also updated to allow the strategy to be specified in the Collector CRD. New tests have been introduced to confirm the strategy works as expected. All previous tests should continue working.