Files
odo/tests/helper/labels.go
Armel Soro 2508cf7362 Run only of asubset of the integration tests in OpenShift CI
Rationale: All of the integration tests are already covered in GitHb CI
(using Kubernetes), and they tend to be a bit flaky on OpenShift.
2024-05-18 09:15:33 +02:00

53 lines
916 B
Go

package helper
import (
"github.com/onsi/ginkgo/v2"
)
const (
LabelNoCluster = "nocluster"
LabelUnauth = "unauth"
LabelPodman = "podman"
LabelServiceBinding = "servicebinding"
LabelSkipOnOpenShift = "skiponopenshift"
)
func NeedsCluster(labels []string) bool {
for _, label := range labels {
if label == LabelNoCluster {
return false
}
if label == LabelPodman {
return false
}
}
return true
}
func NeedsPodman(labels []string) bool {
for _, label := range labels {
if label == LabelPodman {
return true
}
}
return false
}
func IsAuth(labels []string) bool {
for _, label := range labels {
if label == LabelUnauth {
return false
}
}
return true
}
func LabelPodmanIf(value bool, args ...interface{}) []interface{} {
res := []interface{}{}
if value {
res = append(res, ginkgo.Label(LabelPodman))
}
res = append(res, args...)
return res
}