mirror of https://github.com/k3s-io/k3s
commit
be9dfcaec4
|
@ -535,6 +535,15 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
|
||||||
defer func() {
|
defer func() {
|
||||||
glog.V(4).Infof("Finished syncing daemon set %q (%v)", key, time.Now().Sub(startTime))
|
glog.V(4).Infof("Finished syncing daemon set %q (%v)", key, time.Now().Sub(startTime))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if !dsc.podStoreSynced() {
|
||||||
|
// Sleep so we give the pod reflector goroutine a chance to run.
|
||||||
|
time.Sleep(PodStoreSyncedPollPeriod)
|
||||||
|
glog.Infof("Waiting for pods controller to sync, requeuing ds %v", key)
|
||||||
|
dsc.queue.Add(key)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
obj, exists, err := dsc.dsStore.Store.GetByKey(key)
|
obj, exists, err := dsc.dsStore.Store.GetByKey(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Infof("Unable to retrieve ds %v from store: %v", key, err)
|
glog.Infof("Unable to retrieve ds %v from store: %v", key, err)
|
||||||
|
@ -547,13 +556,6 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
ds := obj.(*extensions.DaemonSet)
|
ds := obj.(*extensions.DaemonSet)
|
||||||
if !dsc.podStoreSynced() {
|
|
||||||
// Sleep so we give the pod reflector goroutine a chance to run.
|
|
||||||
time.Sleep(PodStoreSyncedPollPeriod)
|
|
||||||
glog.Infof("Waiting for pods controller to sync, requeuing ds %v", ds.Name)
|
|
||||||
dsc.enqueueDaemonSet(ds)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't process a daemon set until all its creations and deletions have been processed.
|
// Don't process a daemon set until all its creations and deletions have been processed.
|
||||||
// For example if daemon set foo asked for 3 new daemon pods in the previous call to manage,
|
// For example if daemon set foo asked for 3 new daemon pods in the previous call to manage,
|
||||||
|
|
|
@ -397,6 +397,14 @@ func (dc *DeploymentController) syncDeployment(key string) error {
|
||||||
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Now().Sub(startTime))
|
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Now().Sub(startTime))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if !dc.rsStoreSynced() || !dc.podStoreSynced() {
|
||||||
|
// Sleep so we give the replica set / pod reflector goroutine a chance to run.
|
||||||
|
time.Sleep(StoreSyncedPollPeriod)
|
||||||
|
glog.Infof("Waiting for replica set / pod controller to sync, requeuing deployment %s", key)
|
||||||
|
dc.queue.Add(key)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
obj, exists, err := dc.dStore.Store.GetByKey(key)
|
obj, exists, err := dc.dStore.Store.GetByKey(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Infof("Unable to retrieve deployment %v from store: %v", key, err)
|
glog.Infof("Unable to retrieve deployment %v from store: %v", key, err)
|
||||||
|
@ -410,13 +418,6 @@ func (dc *DeploymentController) syncDeployment(key string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
d := *obj.(*extensions.Deployment)
|
d := *obj.(*extensions.Deployment)
|
||||||
if !dc.rsStoreSynced() || !dc.podStoreSynced() {
|
|
||||||
// Sleep so we give the replica set / pod reflector goroutine a chance to run.
|
|
||||||
time.Sleep(StoreSyncedPollPeriod)
|
|
||||||
glog.Infof("Waiting for replica set / pod controller to sync, requeuing deployment %s", d.Name)
|
|
||||||
dc.enqueueDeployment(&d)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if d.Spec.Paused {
|
if d.Spec.Paused {
|
||||||
// Ignore paused deployments
|
// Ignore paused deployments
|
||||||
|
|
|
@ -288,6 +288,14 @@ func (jm *JobController) syncJob(key string) error {
|
||||||
glog.V(4).Infof("Finished syncing job %q (%v)", key, time.Now().Sub(startTime))
|
glog.V(4).Infof("Finished syncing job %q (%v)", key, time.Now().Sub(startTime))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if !jm.podStoreSynced() {
|
||||||
|
// Sleep so we give the pod reflector goroutine a chance to run.
|
||||||
|
time.Sleep(replicationcontroller.PodStoreSyncedPollPeriod)
|
||||||
|
glog.V(4).Infof("Waiting for pods controller to sync, requeuing job %v", key)
|
||||||
|
jm.queue.Add(key)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
obj, exists, err := jm.jobStore.Store.GetByKey(key)
|
obj, exists, err := jm.jobStore.Store.GetByKey(key)
|
||||||
if !exists {
|
if !exists {
|
||||||
glog.V(4).Infof("Job has been deleted: %v", key)
|
glog.V(4).Infof("Job has been deleted: %v", key)
|
||||||
|
@ -300,13 +308,6 @@ func (jm *JobController) syncJob(key string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
job := *obj.(*extensions.Job)
|
job := *obj.(*extensions.Job)
|
||||||
if !jm.podStoreSynced() {
|
|
||||||
// Sleep so we give the pod reflector goroutine a chance to run.
|
|
||||||
time.Sleep(replicationcontroller.PodStoreSyncedPollPeriod)
|
|
||||||
glog.V(4).Infof("Waiting for pods controller to sync, requeuing job %v", job.Name)
|
|
||||||
jm.enqueueController(&job)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the expectations of the job before counting active pods, otherwise a new pod can sneak in
|
// Check the expectations of the job before counting active pods, otherwise a new pod can sneak in
|
||||||
// and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
// and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
||||||
|
|
|
@ -407,6 +407,14 @@ func (rsc *ReplicaSetController) syncReplicaSet(key string) error {
|
||||||
glog.V(4).Infof("Finished syncing replica set %q (%v)", key, time.Now().Sub(startTime))
|
glog.V(4).Infof("Finished syncing replica set %q (%v)", key, time.Now().Sub(startTime))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if !rsc.podStoreSynced() {
|
||||||
|
// Sleep so we give the pod reflector goroutine a chance to run.
|
||||||
|
time.Sleep(PodStoreSyncedPollPeriod)
|
||||||
|
glog.Infof("Waiting for pods controller to sync, requeuing ReplicaSet %v", key)
|
||||||
|
rsc.queue.Add(key)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
obj, exists, err := rsc.rsStore.Store.GetByKey(key)
|
obj, exists, err := rsc.rsStore.Store.GetByKey(key)
|
||||||
if !exists {
|
if !exists {
|
||||||
glog.Infof("ReplicaSet has been deleted %v", key)
|
glog.Infof("ReplicaSet has been deleted %v", key)
|
||||||
|
@ -419,13 +427,6 @@ func (rsc *ReplicaSetController) syncReplicaSet(key string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
rs := *obj.(*extensions.ReplicaSet)
|
rs := *obj.(*extensions.ReplicaSet)
|
||||||
if !rsc.podStoreSynced() {
|
|
||||||
// Sleep so we give the pod reflector goroutine a chance to run.
|
|
||||||
time.Sleep(PodStoreSyncedPollPeriod)
|
|
||||||
glog.Infof("Waiting for pods controller to sync, requeuing ReplicaSet %v", rs.Name)
|
|
||||||
rsc.enqueueReplicaSet(&rs)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the expectations of the ReplicaSet before counting active pods, otherwise a new pod can sneak
|
// Check the expectations of the ReplicaSet before counting active pods, otherwise a new pod can sneak
|
||||||
// in and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
// in and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
||||||
|
|
|
@ -409,6 +409,14 @@ func (rm *ReplicationManager) syncReplicationController(key string) error {
|
||||||
glog.V(4).Infof("Finished syncing controller %q (%v)", key, time.Now().Sub(startTime))
|
glog.V(4).Infof("Finished syncing controller %q (%v)", key, time.Now().Sub(startTime))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if !rm.podStoreSynced() {
|
||||||
|
// Sleep so we give the pod reflector goroutine a chance to run.
|
||||||
|
time.Sleep(PodStoreSyncedPollPeriod)
|
||||||
|
glog.Infof("Waiting for pods controller to sync, requeuing rc %v", key)
|
||||||
|
rm.queue.Add(key)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
obj, exists, err := rm.rcStore.Store.GetByKey(key)
|
obj, exists, err := rm.rcStore.Store.GetByKey(key)
|
||||||
if !exists {
|
if !exists {
|
||||||
glog.Infof("Replication Controller has been deleted %v", key)
|
glog.Infof("Replication Controller has been deleted %v", key)
|
||||||
|
@ -421,13 +429,6 @@ func (rm *ReplicationManager) syncReplicationController(key string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
rc := *obj.(*api.ReplicationController)
|
rc := *obj.(*api.ReplicationController)
|
||||||
if !rm.podStoreSynced() {
|
|
||||||
// Sleep so we give the pod reflector goroutine a chance to run.
|
|
||||||
time.Sleep(PodStoreSyncedPollPeriod)
|
|
||||||
glog.Infof("Waiting for pods controller to sync, requeuing rc %v", rc.Name)
|
|
||||||
rm.enqueueController(&rc)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the expectations of the rc before counting active pods, otherwise a new pod can sneak in
|
// Check the expectations of the rc before counting active pods, otherwise a new pod can sneak in
|
||||||
// and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
// and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
||||||
|
|
Loading…
Reference in New Issue