Merge pull request #62842 from Lion-Wei/ipvs-delay

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix ipvs delay on sync rules

**What this PR does / why we need it**:
Fix most of flaky test cases in `gci-gce-ipvs` CI.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62839

**Special notes for your reviewer**:
Make sure `proxier.initialized` be successfully set.

**Release note**:
```release-note
NONE
```
pull/8/head
Kubernetes Submit Queue 2018-04-19 03:55:40 -07:00 committed by GitHub
commit b1357da473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -639,8 +639,10 @@ func (proxier *Proxier) OnEndpointsDelete(endpoints *api.Endpoints) {
func (proxier *Proxier) OnEndpointsSynced() {
proxier.mu.Lock()
proxier.endpointsSynced = true
proxier.setInitialized(proxier.servicesSynced && proxier.endpointsSynced)
proxier.mu.Unlock()
// Sync unconditionally - this is called once per lifetime.
proxier.syncProxyRules()
}