Skip to content

Commit

Permalink
Fix tests for BVT testing (stolostron#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 <[email protected]>

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

Signed-off-by: Coleen Iona Quadros <[email protected]>

* force add on obervability label for kind

Signed-off-by: Coleen Iona Quadros <[email protected]>

* add logs to tests

Signed-off-by: Coleen Iona Quadros <[email protected]>

* update

Signed-off-by: Coleen Iona Quadros <[email protected]>

* update

Signed-off-by: Coleen Iona Quadros <[email protected]>

* update

Signed-off-by: Coleen Iona Quadros <[email protected]>

---------

Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros authored and JoaoBraveCoding committed Sep 9, 2024
1 parent 42751af commit 6f9a0d2
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 6f9a0d2

Please sign in to comment.