-
Notifications
You must be signed in to change notification settings - Fork 983
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
Implemented pod batching in the allocation/provisioner controller #503
Conversation
FYI, I'm planning on deprecating GenericController, since our controllers have drifted significantly. Checkout the alternative here: #498 |
@@ -12,17 +12,19 @@ See the License for the specific language governing permissions and | |||
limitations under the License. | |||
*/ | |||
|
|||
package allocation | |||
package allocation_test |
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.
Why change up the package here? I know it's a testing style, but it's outside of the convention of the project thus far. Should we be moving to adopt this pattern? I find it a bit of a surprising convention of golang and I haven't yet seen the value over just using the same package.
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 a protection against using non-public fields. For example, when I changed the AllocationController to have public fields so we can configure the batcher in the tests, it caught it in it's own suite test which was more noticeable since I was working in that package. I actually thought about changing it back without the "_test", but the cloudprovider suite tests also needs to create a controller, so it really should behave the same.
In general, I think we should absolutely stick with this convention.
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.
Nicely done on many fronts. I'm a bit wary of the complexity of the batcher, but I think it's necessary complexity. I'd love to see a comprehensive suite of tests exercising the batcher, but feel free to implement in a followon PR.
Otherwise just a couple naming nits here and there. Most of the batcher naming nits are just to help me wrap my mind around it.
|
||
// retrieveProvisionerFrom fetches the provisioner and returns a raw provisioner that was persisted in the api server | ||
// and a provisioner w/ default runtime values added that should not be persisted | ||
func (c *Controller) retrieveProvisionerFrom(ctx context.Context, req reconcile.Request) (*v1alpha2.Provisioner, *v1alpha2.Provisioner, error) { |
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'm a fan of the convention provisionerFor(ctx, req)
Issue, if available:
#467
Description of changes:
Register()
method that was already done for the Expiration controller.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.