Skip to content

Commit d6055d9

Browse files
Merge pull request #662 from ada333/Issue-632
Add logging for INJECT_CLUSTER_PROXY_ENV parse errors
2 parents 1db185b + ffa1a86 commit d6055d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/odh-notebook-controller/controllers/notebook_webhook.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,11 @@ func (w *NotebookWebhook) Handle(ctx context.Context, req admission.Request) adm
392392
if raw, ok := os.LookupEnv("INJECT_CLUSTER_PROXY_ENV"); ok {
393393
if val, err := strconv.ParseBool(strings.TrimSpace(raw)); err == nil {
394394
injectClusterProxy = val
395+
} else {
396+
log.Info("Failed to parse INJECT_CLUSTER_PROXY_ENV as boolean, defaulting to false", "value", raw, "error", err)
395397
}
396398
}
397-
if w.ClusterWideProxyIsEnabled() && injectClusterProxy {
399+
if injectClusterProxy && w.ClusterWideProxyIsEnabled() {
398400
err = InjectProxyConfigEnvVars(notebook)
399401
if err != nil {
400402
return admission.Errored(http.StatusInternalServerError, err)

0 commit comments

Comments
 (0)