(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func setupForTest(t *testing.T) { |
| 53 | if err := os.Setenv("WATCH_NAMESPACE", testNamespace); err != nil { |
| 54 | t.Fatalf("failed to set up for test: %s", err) |
| 55 | } |
| 56 | infrastructure.InitializeForTesting(infrastructure.Kubernetes) |
| 57 | setDefaultPodSecurityContext() |
| 58 | setDefaultContainerSecurityContext() |
| 59 | setDefaultOverrideConfig() |
| 60 | configNamespace = testNamespace |
| 61 | originalDefaultConfig := defaultConfig.DeepCopy() |
| 62 | t.Cleanup(func() { |
| 63 | internalConfig = nil |
| 64 | defaultConfig = originalDefaultConfig |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | func buildConfig(config *v1alpha1.OperatorConfiguration) *v1alpha1.DevWorkspaceOperatorConfig { |
| 69 | return &v1alpha1.DevWorkspaceOperatorConfig{ |
no test coverage detected