@@ -4,7 +4,11 @@ import (
4
4
"flag"
5
5
"os"
6
6
"reflect"
7
+ "strconv"
7
8
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"
8
12
"k8s.io/kubernetes/test/e2e/framework"
9
13
10
14
"github.com/spf13/cobra"
@@ -95,12 +99,22 @@ func main() {
95
99
// the environmental skip code from the enhancement once its implemented.
96
100
// - Make sure to account for test renames that occur because of removal of these
97
101
// 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
+ }
104
118
105
119
specs = filterOutDisabledSpecs (specs )
106
120
addLabelsToSpecs (specs )
0 commit comments