From ccaebbf2e99c1b15483223b29bc96a0bec60f855 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Mon, 9 Aug 2021 14:16:41 +0200 Subject: [PATCH] test/framework: fix disable metrics collection should not disable watching deployment logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- test/framework/clusterctl/clusterctl_helpers.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index 055892dd967c..db8baea5e9d3 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -109,15 +109,14 @@ func InitManagementClusterAndWatchControllerLogs(ctx context.Context, input Init LogPath: filepath.Join(input.LogFolder, "controllers"), }) - if input.DisableMetricsCollection { - return + if !input.DisableMetricsCollection { + framework.WatchPodMetrics(ctx, framework.WatchPodMetricsInput{ + GetLister: client, + ClientSet: input.ClusterProxy.GetClientSet(), + Deployment: deployment, + MetricsPath: filepath.Join(input.LogFolder, "controllers"), + }) } - framework.WatchPodMetrics(ctx, framework.WatchPodMetricsInput{ - GetLister: client, - ClientSet: input.ClusterProxy.GetClientSet(), - Deployment: deployment, - MetricsPath: filepath.Join(input.LogFolder, "controllers"), - }) } }