k3s/test/integration
Kubernetes Submit Queue e7d01097dc Merge pull request #29971 from caesarxuchao/fix-kubectl-rolling-update-with-gc
Automatic merge from submit-queue

[GarbageCollector] Fix kubectl rolling-update to work with GC

This changes the order of the [Rename()](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532) function. After the change, Rename() first deletes the old RC and orphans its pods, then creates the new RC, which will then have a chance to adopt the orphaned pods.

This also fixes the "should support rolling-update to same image" [test](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/kubectl.go#L915) when the garbage collector is on.

Here is the detailed explanation on why the test would have failed:
`kubectl rolling-update` will [rename](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532-L546) the RC. It first creates the an identical RC (including spec.selectors) with the new name, then it deletes the existing RC. When GC is turned on, the newly created RC cannot adopt the existing pod, because it has a controllerRef pointing to the exising RC, so the new RC will create new pods and expect to see the creation. However, the new RC and the old RC have the same selector, so sometimes the old RC, instead of the new RC, has its [expectation lowered](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346-L362), the new RC's expectation will stuck forever. The e2e test then times out when executing `kubectl delete newRC`, because there is the new RC will not scale down as its expectation is not fulfilled.

A side-note, we should fix [rm.getPodController()](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346) to respect pod's controllerref, that will prevent similar bugs.

Also note that an old version `kubectl rolling-update` will not work with the GC. We cannot fix that.
2016-08-04 20:48:10 -07:00
..
auth interesting changes to add tokenreviews endpoint to implement webhook 2016-08-03 08:37:45 -04:00
client move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
configmap move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
framework fix kubectl rolling-update when GC is enabled 2016-08-03 15:57:03 -07:00
garbagecollector move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
kubectl move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
master Compile fixes for master_benchmark_test.go 2016-07-08 08:02:04 +02:00
metrics move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
openshift move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
persistentvolumes Merge pull request #27942 from jsafrane/integration-modify 2016-08-03 11:18:38 -07:00
pods move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
quota move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
replicaset Merge pull request #29978 from hodovska/sharedInformer-fixup 2016-08-04 09:00:23 -07:00
replicationcontroller Collapse duplicate informer creation paths 2016-08-04 09:02:13 +02:00
scheduler move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
secrets move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00
serviceaccount Return (bool, error) in Authorizer.Authorize() 2016-07-18 12:06:54 +02:00
storageclasses API Changes for StorageClass 2016-07-28 19:01:01 -04:00
benchmark-controller.json build/pause: write in C 2016-05-04 21:45:52 -04:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
utils.go move integration tests into individual pacakges 2016-07-07 00:54:15 -07:00