kubernetes/pkg/api/v1
k8s-merge-robot c63ac4e664 Merge pull request #24331 from jsafrane/devel/refactor-binder
Automatic merge from submit-queue

Refactor persistent volume controller

Here is complete persistent controller as designed in https://github.com/pmorie/pv-haxxz/blob/master/controller.go

It's feature complete and compatible with current binder/recycler/provisioner. No new features, it *should* be much more stable and predictable.

Testing
--
The unit test framework is quite complicated, still it was necessary to reach reasonable coverage (78% in `persistentvolume_controller.go`). The untested part are error cases, which are quite hard to test in reasonable way - sure, I can inject a VersionConflictError on any object update and check the error bubbles up to appropriate places, but the real test would be to run `syncClaim`/`syncVolume` again and check it recovers appropriately from the error in the next periodic sync. That's the hard part.

Organization
---
The PR starts with `rm -rf kubernetes/pkg/controller/persistentvolume`. I find it easier to read when I see only the new controller without old pieces scattered around.
[`types.go` from the old controller is reused to speed up matching a bit, the code looks solid and has 95% unit test coverage].

I tried to split the PR into smaller patches, let me know what you think.

~~TODO~~
--

* ~~Missing: provisioning, recycling~~.
* ~~Fix integration tests~~
* ~~Fix e2e tests~~

@kubernetes/sig-storage

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24331)
<!-- Reviewable:end -->

Fixes #15632
2016-05-19 03:06:46 -07:00
..
backward_compatibility_test.go update CodecFor for GroupVersion 2015-12-15 10:56:00 -05:00
conversion_generated.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
conversion_test.go Refactor diff into sub pkg 2016-03-21 20:21:39 +08:00
conversion.go API for adding init containers 2016-05-17 00:29:49 -04:00
deep_copy_generated.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
defaults_test.go Switch API objects to not register per version codecs 2016-01-22 01:10:21 -05:00
defaults.go Cleanup the code with new engine-api 2016-04-29 13:34:38 -07:00
doc.go Switch to new generator 2016-04-11 08:04:45 +02:00
generated.pb.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
generated.proto implement taints and tolerations 2016-05-18 15:06:23 +00:00
register.go Implement a streaming serializer for watch 2016-04-11 11:22:05 -04:00
types_swagger_doc_generated.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
types.generated.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
types.go Merge pull request #24331 from jsafrane/devel/refactor-binder 2016-05-19 03:06:46 -07:00