Merge pull request #60968 from loburm/fix_gke_logging_test

Automatic merge from submit-queue (batch tested with PRs 60737, 60739, 61080, 60968, 60951). 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 broken gke regional logging test.

**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 #60882

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-03-13 12:27:04 -07:00 committed by GitHub
commit ae990bb5a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -162,8 +162,11 @@ var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackd
}()
ginkgo.By("Waiting for events to ingest")
zone := framework.TestContext.CloudConfig.Zone
c := utils.NewLogChecker(p, utils.UntilFirstEntryFromZone(zone), utils.JustTimeout, "")
location := framework.TestContext.CloudConfig.Zone
if framework.TestContext.CloudConfig.MultiZone {
location = framework.TestContext.CloudConfig.Region
}
c := utils.NewLogChecker(p, utils.UntilFirstEntryFromLocation(location), utils.JustTimeout, "")
err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
framework.ExpectNoError(err)
})

View File

@ -55,12 +55,12 @@ func UntilFirstEntryFromLog(log string) IngestionPred {
}
}
// UntilFirstEntryFromZone is a IngestionPred that checks that at least one
// UntilFirstEntryFromLocation is a IngestionPred that checks that at least one
// entry from the log with a given name was ingested.
func UntilFirstEntryFromZone(zone string) IngestionPred {
func UntilFirstEntryFromLocation(location string) IngestionPred {
return func(_ string, entries []LogEntry) (bool, error) {
for _, e := range entries {
if e.Location == zone {
if e.Location == location {
return true, nil
}
}