Skip to content

Commit 8c42f4e

Browse files
authored
fix: improve connection URL construction in pod webhook (#18)
- Remove unused 'path' package import - Replace path.Join with direct string formatting for better URL construction in tensor fusion connection endpoint
1 parent 0c19f85 commit 8c42f4e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/webhook/v1/pod_webhook.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"encoding/json"
2222
"fmt"
2323
"net/http"
24-
"path"
2524

2625
"gomodules.xyz/jsonpatch/v2"
2726
corev1 "k8s.io/api/core/v1"
@@ -200,7 +199,7 @@ func (m *TensorFusionPodMutator) patchTFClient(pod *corev1.Pod, tfReq []TFReq) (
200199
})
201200
container.Env = append(container.Env, corev1.EnvVar{
202201
Name: constants.GetConnectionURLEnv,
203-
Value: path.Join(m.Config.OperatorEndpoint, fmt.Sprintf("/api/connection?name=%s,namespace=%s", connectionName, connectionNamespace)),
202+
Value: fmt.Sprintf("%s/api/connection?name=%s,namespace=%s", m.Config.OperatorEndpoint, connectionName, connectionNamespace),
204203
})
205204
}
206205
}

0 commit comments

Comments
 (0)