Add an option for resource-gatherer to look only on master node

This commit is contained in:
gmarek
2016-05-12 09:49:17 +02:00
parent 4bb30e0097
commit 74773827ba
3 changed files with 27 additions and 18 deletions

View File

@@ -149,8 +149,11 @@ func (f *Framework) BeforeEach() {
Logf("Skipping waiting for service account")
}
if TestContext.GatherKubeSystemResourceUsageData {
f.gatherer, err = NewResourceUsageGatherer(f.Client, ResourceGathererOptions{inKubemark: ProviderIs("kubemark")})
if TestContext.GatherKubeSystemResourceUsageData != "false" && TestContext.GatherKubeSystemResourceUsageData != "none" {
f.gatherer, err = NewResourceUsageGatherer(f.Client, ResourceGathererOptions{
inKubemark: ProviderIs("kubemark"),
masterOnly: TestContext.GatherKubeSystemResourceUsageData == "master",
})
if err != nil {
Logf("Error while creating NewResourceUsageGatherer: %v", err)
} else {
@@ -209,7 +212,7 @@ func (f *Framework) AfterEach() {
}
summaries := make([]TestDataSummary, 0)
if TestContext.GatherKubeSystemResourceUsageData && f.gatherer != nil {
if TestContext.GatherKubeSystemResourceUsageData != "false" && TestContext.GatherKubeSystemResourceUsageData != "none" && f.gatherer != nil {
By("Collecting resource usage data")
summaries = append(summaries, f.gatherer.stopAndSummarize([]int{90, 99, 100}, f.AddonResourceConstraints))
}