Skip to content

Commit f0c7a7f

Browse files
committed
fix(mlflow): use kubernetes-namespaced tracking auth
Switch MLFLOW_TRACKING_AUTH from "kubernetes" to "kubernetes-namespaced" to enable namespace-scoped authentication, aligning with the X-MLFLOW-WORKSPACE header already sent per namespace. Signed-off-by: Ignas Baranauskas <ibaranau@redhat.com>
1 parent 47652c0 commit f0c7a7f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

kagenti-operator/internal/controller/mlflow_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func (r *MLflowReconciler) resolveTrackingURI(ctx context.Context) string {
205205
func mlflowEnvVars(trackingURI, experimentID, experimentName string) map[string]string {
206206
return map[string]string{
207207
"MLFLOW_TRACKING_URI": trackingURI,
208-
"MLFLOW_TRACKING_AUTH": "kubernetes",
208+
"MLFLOW_TRACKING_AUTH": "kubernetes-namespaced",
209209
"MLFLOW_EXPERIMENT_ID": experimentID,
210210
"MLFLOW_EXPERIMENT_NAME": experimentName,
211211
"MLFLOW_TRACKING_SERVER_CERT_PATH": "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt",
@@ -231,7 +231,7 @@ func (r *MLflowReconciler) configureDeployment(ctx context.Context, dep *appsv1.
231231
annotations[AnnotationMLflowExperimentID] = experimentID
232232
annotations[AnnotationMLflowExperimentName] = experimentName
233233
annotations[AnnotationMLflowTrackingURI] = trackingURI
234-
annotations[AnnotationMLflowTrackingAuth] = "kubernetes"
234+
annotations[AnnotationMLflowTrackingAuth] = "kubernetes-namespaced"
235235
latest.Spec.Template.Annotations = annotations
236236

237237
changed := false

kagenti-operator/internal/controller/mlflow_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ var _ = Describe("MLflow Controller", func() {
229229
envMap[e.Name] = e.Value
230230
}
231231
Expect(envMap["MLFLOW_TRACKING_URI"]).To(Equal(server.URL))
232-
Expect(envMap["MLFLOW_TRACKING_AUTH"]).To(Equal("kubernetes"))
232+
Expect(envMap["MLFLOW_TRACKING_AUTH"]).To(Equal("kubernetes-namespaced"))
233233
Expect(envMap["MLFLOW_EXPERIMENT_ID"]).To(Equal("exp-123"))
234234
Expect(envMap["MLFLOW_EXPERIMENT_NAME"]).To(Equal("mlflow-full"))
235235
Expect(envMap["MLFLOW_TRACKING_SERVER_CERT_PATH"]).To(Equal("/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"))
236236

237237
Expect(updated.Spec.Template.Annotations[AnnotationMLflowExperimentID]).To(Equal("exp-123"))
238238
Expect(updated.Spec.Template.Annotations[AnnotationMLflowExperimentName]).To(Equal("mlflow-full"))
239239
Expect(updated.Spec.Template.Annotations[AnnotationMLflowTrackingURI]).To(Equal(server.URL))
240-
Expect(updated.Spec.Template.Annotations[AnnotationMLflowTrackingAuth]).To(Equal("kubernetes"))
240+
Expect(updated.Spec.Template.Annotations[AnnotationMLflowTrackingAuth]).To(Equal("kubernetes-namespaced"))
241241
})
242242

243243
It("should use default SA name when none is specified", func() {

0 commit comments

Comments
 (0)