add disable-scc label to kube e2e tests
@@ -210,13 +210,22 @@ func createTestingNS(baseName string, c kclientset.Interface, labels map[string]
baseName = "e2e-" + baseName
}
+ // we skip SCC if this is a kube e2e test
+ isKubeE2ENamespace := strings.HasPrefix(baseName, "e2e-k8s-") || (isKubernetesE2ETest() && !skipTestNamespaceCustomization())
+ if isKubeE2ENamespace {
+ if labels == nil {
+ labels = map[string]string{}
+ }
+ labels["security.openshift.io/disable-securitycontextconstraints"] = "true"
+ }
+
ns, err := e2e.CreateTestingNS(baseName, c, labels)
if err != nil {
return ns, err
}
// Add anyuid and privileged permissions for upstream tests
- if strings.HasPrefix(baseName, "e2e-k8s-") || (isKubernetesE2ETest() && !skipTestNamespaceCustomization()) {
+ if isKubeE2ENamespace {
clientConfig, err := GetClientConfig(KubeConfigPath())
if err != nil {
return ns, err
