From 0ccc0ce516c2b32e6feb62af1879c9033e7d88cc Mon Sep 17 00:00:00 2001 From: 0x5457 <0x5457@protonmail.com> Date: Thu, 20 Nov 2025 15:50:49 +0800 Subject: [PATCH] fix: comment out device allocation index assignment and logging in pod webhook --- internal/webhook/v1/pod_webhook.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/webhook/v1/pod_webhook.go b/internal/webhook/v1/pod_webhook.go index 5d73f0e6..b8a7809d 100644 --- a/internal/webhook/v1/pod_webhook.go +++ b/internal/webhook/v1/pod_webhook.go @@ -29,7 +29,6 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/strategicpatch" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -294,8 +293,8 @@ func (m *TensorFusionPodMutator) patchTFClient( // Index must be assigned in webhook stage since scheduler cannot modify Pod // This is a special index resource (1-512), not a real device resource // Index is assigned in ascending order (1, 2, 3, ...) via distributed lock (leader election) - index := m.assignDeviceAllocationIndex(ctx, pod) - log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name) + // index := m.assignDeviceAllocationIndex(ctx, pod) + // log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name) for _, containerIndex := range containerIndices { container := &pod.Spec.Containers[containerIndex] @@ -332,7 +331,7 @@ func (m *TensorFusionPodMutator) patchTFClient( container.Resources.Limits = make(corev1.ResourceList) } // Limit is set to actual index value (1-512) for Device Plugin to match Pod - container.Resources.Limits[constants.PodIndexAnnotation] = resource.MustParse(strconv.Itoa(index)) + // container.Resources.Limits[constants.PodIndexAnnotation] = resource.MustParse(strconv.Itoa(index)) if !isLocalGPU { addConnectionForRemoteFixedReplicaVirtualGPU(pod, container, clientConfig)