Merge pull request #64155 from figo/master

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>.

improve test: verify kubelet.config.Restore only happen once

**What this PR does / why we need it**:
This patch is to add additional test coverage of pod config restore, 
it verifies that restore can only happen once.

in the second restore attempt, we should expect no error and no channel update.

**Which issue(s) this PR fixes**:

this is a test improvement based on test been added at https://github.com/kubernetes/kubernetes/pull/63553


**Special notes for your reviewer**:

**Release note**:

```release-note
None
```

/sig node
/cc @rphillips @jiayingz @vikaschoudhary16 @anfernee @Random-Liu  @dchen1107  @derekwaynecarr 
@vishh @yujuhong @tallclair
This commit is contained in:
Kubernetes Submit Queue 2018-05-29 16:17:28 -07:00 committed by GitHub
commit c6e0a225f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,4 +451,10 @@ func TestPodRestore(t *testing.T) {
t.Fatalf("Restore returned error: %v", err)
}
expectPodUpdate(t, ch, CreatePodUpdate(kubetypes.RESTORE, kubetypes.ApiserverSource, pod))
// Verify Restore only happen once
if err := config.Restore(tmpDir, channel); err != nil {
t.Fatalf("The second restore returned error: %v", err)
}
expectNoPodUpdate(t, ch)
}