@@ -4,7 +4,11 @@ import (
44 "flag"
55 "os"
66 "reflect"
7+ "strconv"
78
9+ et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
10+ "github.com/sirupsen/logrus"
11+ "k8s.io/kubernetes/openshift-hack/e2e/annotate/generated"
812 "k8s.io/kubernetes/test/e2e/framework"
913
1014 "github.com/spf13/cobra"
@@ -95,12 +99,22 @@ func main() {
9599 // the environmental skip code from the enhancement once its implemented.
96100 // - Make sure to account for test renames that occur because of removal of these
97101 // annotations
98- //TODO: this will have to be added back for now, but can we use the new logic anyways? test it...
99- //specs.Walk(func(spec *et.ExtensionTestSpec) {
100- // if annotations, ok := generated.Annotations[spec.Name]; ok {
101- // spec.Name += annotations
102- // }
103- //})
102+ var omitAnnotations bool
103+ omitAnnotationsVal := os .Getenv ("OMIT_ANNOTATIONS" )
104+ if omitAnnotationsVal != "" {
105+ omitAnnotations , err = strconv .ParseBool (omitAnnotationsVal )
106+ if err != nil {
107+ logrus .WithError (err ).Fatal ("Failed to parse OMIT_ANNOTATIONS" )
108+ }
109+ }
110+ if ! omitAnnotations {
111+ logrus .Infof ("adding annotations as OMIT_ANNOTATIONS was either false, or not provided" )
112+ specs .Walk (func (spec * et.ExtensionTestSpec ) {
113+ if annotations , ok := generated .Annotations [spec .Name ]; ok {
114+ spec .Name += annotations
115+ }
116+ })
117+ }
104118
105119 specs = filterOutDisabledSpecs (specs )
106120 addLabelsToSpecs (specs )
0 commit comments