Skip to content

Commit

Permalink
Fix tests for BVT testing (#1598)
Browse files Browse the repository at this point in the history
* update tests to ignore clusters that dont have observability addon installed

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

* update tests to ignore clusters that dont have observability addon installed

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

* force add on obervability label for kind

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

* add logs to tests

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

* update

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

* update

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

* update

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>

---------

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
  • Loading branch information
coleenquadros authored Sep 4, 2024
1 parent 578db6d commit 40d69e8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/pkg/utils/mco_managedcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package utils
import (
"context"
"errors"
"os"

goversion "github.com/hashicorp/go-version"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -52,12 +53,13 @@ func ListManagedClusters(opt TestOptions) ([]string, error) {
metadata := obj.Object["metadata"].(map[string]interface{})
name := metadata["name"].(string)
labels := metadata["labels"].(map[string]interface{})
if os.Getenv("IS_KIND_ENV") == "true" {
// We do not have the obs add on label added in kind cluster
clusterNames = append(clusterNames, name)
continue
}
if labels != nil {
obsControllerStr := ""
if obsController, ok := labels["feature.open-cluster-management.io/addon-observability-controller"]; ok {
obsControllerStr = obsController.(string)
}
if obsControllerStr != "unreachable" {
if obsController, ok := labels["feature.open-cluster-management.io/addon-observability-controller"]; ok && obsController.(string) != "unreachable" {
clusterNames = append(clusterNames, name)
}
}
Expand Down

0 comments on commit 40d69e8

Please sign in to comment.