...
1 package helper
2
3 import (
4 "github.com/onsi/ginkgo/v2"
5 )
6
7 const (
8 LabelNoCluster = "nocluster"
9 LabelUnauth = "unauth"
10 LabelPodman = "podman"
11 LabelServiceBinding = "servicebinding"
12 LabelSkipOnOpenShift = "skiponopenshift"
13 )
14
15 func NeedsCluster(labels []string) bool {
16 for _, label := range labels {
17 if label == LabelNoCluster {
18 return false
19 }
20 if label == LabelPodman {
21 return false
22 }
23 }
24 return true
25 }
26
27 func NeedsPodman(labels []string) bool {
28 for _, label := range labels {
29 if label == LabelPodman {
30 return true
31 }
32 }
33 return false
34 }
35
36 func IsAuth(labels []string) bool {
37 for _, label := range labels {
38 if label == LabelUnauth {
39 return false
40 }
41 }
42 return true
43 }
44
45 func LabelPodmanIf(value bool, args ...interface{}) []interface{} {
46 res := []interface{}{}
47 if value {
48 res = append(res, ginkgo.Label(LabelPodman))
49 }
50 res = append(res, args...)
51 return res
52 }
53
View as plain text