mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Rationale: All of the integration tests are already covered in GitHb CI (using Kubernetes), and they tend to be a bit flaky on OpenShift.
53 lines
916 B
Go
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
|
|
}
|