Skip to content

Commit 4af55e7

Browse files
authored
NO-JIRA: chore(dev): ensure same webhookCertDir location on Linux and macOS (#612)
This is necessary to make the ktunnel deployment work on macOS.
1 parent f67a2e7 commit 4af55e7

File tree

1 file changed

+7
-2
lines changed
  • components/odh-notebook-controller

1 file changed

+7
-2
lines changed

components/odh-notebook-controller/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func getControllerNamespace() (string, error) {
7979
}
8080

8181
func main() {
82-
var metricsAddr, probeAddr, oauthProxyImage string
82+
var metricsAddr, probeAddr, oauthProxyImage, webhookCertDir string
8383
var webhookPort int
8484
var enableLeaderElection, enableDebugLogging bool
8585
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080",
@@ -88,6 +88,10 @@ func main() {
8888
"The address the probe endpoint binds to.")
8989
flag.StringVar(&oauthProxyImage, "oauth-proxy-image", controllers.OAuthProxyImage,
9090
"Image of the OAuth proxy sidecar container.")
91+
// specified explicitly, since on macOS the default temporary directory often resolves to a path under /var/folders/...
92+
// this default path in /tmp/ is already hardcoded in the Makefile and manifests used for ktunnel deployment
93+
flag.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs",
94+
"Directory that contains the server key and certificate for the webhook server.")
9195
flag.IntVar(&webhookPort, "webhook-port", 8443,
9296
"Port that the webhook server serves at.")
9397
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
@@ -112,7 +116,8 @@ func main() {
112116
LeaderElection: enableLeaderElection,
113117
LeaderElectionID: "odh-notebook-controller",
114118
WebhookServer: webhook.NewServer(webhook.Options{
115-
Port: webhookPort,
119+
Port: webhookPort,
120+
CertDir: webhookCertDir,
116121
}),
117122
}
118123

0 commit comments

Comments
 (0)