From 4010d13e7ef3bf928e02db7486f6108e5ad4e8c3 Mon Sep 17 00:00:00 2001 From: Jacob Baungard Hansen Date: Thu, 19 Dec 2024 15:26:47 +0100 Subject: [PATCH] Cleanup of used vars Signed-off-by: Jacob Baungard Hansen --- tests/pkg/utils/mco_dashboard.go | 6 +++++- tests/pkg/utils/mco_grafana.go | 22 ---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/tests/pkg/utils/mco_dashboard.go b/tests/pkg/utils/mco_dashboard.go index 1c81c6d42..2e60698ea 100644 --- a/tests/pkg/utils/mco_dashboard.go +++ b/tests/pkg/utils/mco_dashboard.go @@ -17,6 +17,10 @@ import ( "k8s.io/klog" ) +const ( + trueStr = "true" +) + func ContainDashboard(opt TestOptions, title string) (error, bool) { grafanaConsoleURL := GetGrafanaURL(opt) path := "/api/search?" @@ -30,7 +34,7 @@ func ContainDashboard(opt TestOptions, title string) (error, bool) { } client := &http.Client{} - if os.Getenv("IS_KIND_ENV") != "true" { + if os.Getenv("IS_KIND_ENV") != trueStr { tr := &http.Transport{ // #nosec G402 -- Used in test. TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, diff --git a/tests/pkg/utils/mco_grafana.go b/tests/pkg/utils/mco_grafana.go index 3104928d8..2db8f20e2 100644 --- a/tests/pkg/utils/mco_grafana.go +++ b/tests/pkg/utils/mco_grafana.go @@ -7,29 +7,19 @@ package utils import ( "os" "strings" - "time" "gopkg.in/yaml.v2" "k8s.io/klog" ) var ( - testHeadless bool BearerToken string - baseDomain string - kubeadminUser string - kubeadminCredential string - kubeconfig string - reportFile string optionsFile string - ownerPrefix, ocpRelease string testOptions TestOptions testOptionsContainer TestOptionsContainer - testUITimeout time.Duration - testFailed = false ) func GetGrafanaURL(opt TestOptions) string { @@ -52,18 +42,6 @@ func GetGrafanaURL(opt TestOptions) string { testOptions = testOptionsContainer.Options - // default Headless is `true` - // to disable, set Headless: false - // in options file - if testOptions.Headless == "" { - testHeadless = true - } else { - if testOptions.Headless == "false" { - testHeadless = false - } else { - testHeadless = true - } - } cloudProvider := strings.ToLower(os.Getenv("CLOUD_PROVIDER")) substring1 := "rosa" substring2 := "hcp"