Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit 49c6a36

Browse files
committed
revert attempt to enable webhoks in tests
1 parent 092d183 commit 49c6a36

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

internal/integtest/setup.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ func HNCBeforeSuite() {
7171
By("configuring test environment")
7272
testEnv = &envtest.Environment{
7373
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
74-
// todo(erikgb): Fix tests that breaks when enabling webhooks
75-
//WebhookInstallOptions: envtest.WebhookInstallOptions{
76-
// Paths: []string{filepath.Join("..", "..", "config", "webhook")},
77-
//},
7874
}
7975

8076
By("starting test environment")
@@ -98,14 +94,10 @@ func HNCBeforeSuite() {
9894
// CF: https://github.com/microsoft/azure-databricks-operator/blob/0f722a710fea06b86ecdccd9455336ca712bf775/controllers/suite_test.go
9995

10096
By("creating manager")
101-
webhookInstallOptions := &testEnv.WebhookInstallOptions
10297
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
10398
NewClient: config.NewClient(false),
10499
MetricsBindAddress: "0", // disable metrics serving since 'go test' runs multiple suites in parallel processes
105100
Scheme: scheme.Scheme,
106-
Host: webhookInstallOptions.LocalServingHost,
107-
Port: webhookInstallOptions.LocalServingPort,
108-
CertDir: webhookInstallOptions.LocalServingCertDir,
109101
})
110102
Expect(err).ToNot(HaveOccurred())
111103

@@ -119,7 +111,6 @@ func HNCBeforeSuite() {
119111
TestForest = forest.NewForest()
120112
err = setup.CreateReconcilers(k8sManager, TestForest, opts)
121113
Expect(err).ToNot(HaveOccurred())
122-
setup.CreateWebhooks(k8sManager, TestForest, opts)
123114

124115
By("Creating clients")
125116
K8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})

internal/setup/reconcilers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func Create(log logr.Logger, mgr ctrl.Manager, f *forest.Forest, opts Options) {
3535

3636
if !opts.NoWebhooks {
3737
log.Info("Registering validating webhook (won't work when running locally; use --no-webhooks)")
38-
CreateWebhooks(mgr, f, opts)
38+
createWebhooks(mgr, f, opts)
3939
}
4040

4141
log.Info("Registering reconcilers")

internal/setup/webhooks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func ManageCerts(mgr ctrl.Manager, setupFinished chan struct{}, restartOnSecretR
5454
})
5555
}
5656

57-
// CreateWebhooks creates all mutators and validators.
58-
func CreateWebhooks(mgr ctrl.Manager, f *forest.Forest, opts Options) {
57+
// createWebhooks creates all mutators and validators.
58+
func createWebhooks(mgr ctrl.Manager, f *forest.Forest, opts Options) {
5959
// Create webhook for Hierarchy
6060
mgr.GetWebhookServer().Register(hierarchyconfig.ServingPath, &webhook.Admission{Handler: &hierarchyconfig.Validator{
6161
Log: ctrl.Log.WithName("hierarchyconfig").WithName("validate"),

0 commit comments

Comments
 (0)