Commit 08ea5387 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44566 from wongma7/adc-wait

Automatic merge from submit-queue (batch tested with PRs 44469, 44566, 44467, 44526) WaitForCacheSync before running attachdetach controller @gnufied you wrote the test and @ncdc the TODO comment. Let's just run the pv and pvc informers, we do not care about them in this test. But we want to be able to stop the pod Informer at will, hence not just using informers.Start, is my understanding. ```release-note NONE ```
parents 88412427 e1ce33d9
...@@ -19,6 +19,7 @@ go_library( ...@@ -19,6 +19,7 @@ go_library(
"//pkg/client/informers/informers_generated/externalversions/core/v1:go_default_library", "//pkg/client/informers/informers_generated/externalversions/core/v1:go_default_library",
"//pkg/client/listers/core/v1:go_default_library", "//pkg/client/listers/core/v1:go_default_library",
"//pkg/cloudprovider:go_default_library", "//pkg/cloudprovider:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/controller/volume/attachdetach/cache:go_default_library", "//pkg/controller/volume/attachdetach/cache:go_default_library",
"//pkg/controller/volume/attachdetach/populator:go_default_library", "//pkg/controller/volume/attachdetach/populator:go_default_library",
"//pkg/controller/volume/attachdetach/reconciler:go_default_library", "//pkg/controller/volume/attachdetach/reconciler:go_default_library",
......
...@@ -36,6 +36,7 @@ import ( ...@@ -36,6 +36,7 @@ import (
coreinformers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/core/v1" coreinformers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/core/v1"
corelisters "k8s.io/kubernetes/pkg/client/listers/core/v1" corelisters "k8s.io/kubernetes/pkg/client/listers/core/v1"
"k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache" "k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache"
"k8s.io/kubernetes/pkg/controller/volume/attachdetach/populator" "k8s.io/kubernetes/pkg/controller/volume/attachdetach/populator"
"k8s.io/kubernetes/pkg/controller/volume/attachdetach/reconciler" "k8s.io/kubernetes/pkg/controller/volume/attachdetach/reconciler"
...@@ -224,12 +225,9 @@ func (adc *attachDetachController) Run(stopCh <-chan struct{}) { ...@@ -224,12 +225,9 @@ func (adc *attachDetachController) Run(stopCh <-chan struct{}) {
glog.Infof("Starting attach detach controller") glog.Infof("Starting attach detach controller")
defer glog.Infof("Shutting down attach detach controller") defer glog.Infof("Shutting down attach detach controller")
// TODO uncomment once we agree this is ok and we fix the attach/detach integration test that if !controller.WaitForCacheSync("attach detach", stopCh, adc.podsSynced, adc.nodesSynced, adc.pvcsSynced, adc.pvsSynced) {
// currently fails because it doesn't set pvcsSynced and pvsSynced to alwaysReady, so this return
// controller never runs. }
// if !controller.WaitForCacheSync("attach detach", stopCh, adc.podsSynced, adc.nodesSynced, adc.pvcsSynced, adc.pvsSynced) {
// return
// }
go adc.reconciler.Run(stopCh) go adc.reconciler.Run(stopCh)
go adc.desiredStateOfWorldPopulator.Run(stopCh) go adc.desiredStateOfWorldPopulator.Run(stopCh)
......
...@@ -115,6 +115,8 @@ func TestPodDeletionWithDswp(t *testing.T) { ...@@ -115,6 +115,8 @@ func TestPodDeletionWithDswp(t *testing.T) {
// start controller loop // start controller loop
stopCh := make(chan struct{}) stopCh := make(chan struct{})
go informers.Core().V1().PersistentVolumeClaims().Informer().Run(stopCh)
go informers.Core().V1().PersistentVolumes().Informer().Run(stopCh)
go ctrl.Run(stopCh) go ctrl.Run(stopCh)
waitToObservePods(t, podInformer, 1) waitToObservePods(t, podInformer, 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment