Skip to content

Commit 931c6c1

Browse files
authored
fix: dummy device index issue (#453)
1 parent 984eb1a commit 931c6c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/webhook/v1/pod_webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func (m *TensorFusionPodMutator) createOrUpdateWorkload(
273273
}
274274

275275
func (m *TensorFusionPodMutator) patchTFClient(
276-
_ctx context.Context,
276+
ctx context.Context,
277277
pod *corev1.Pod,
278278
pool *tfv1.GPUPool,
279279
isLocalGPU bool,
@@ -294,8 +294,8 @@ func (m *TensorFusionPodMutator) patchTFClient(
294294
// Index must be assigned in webhook stage since scheduler cannot modify Pod
295295
// This is a special index resource (1-512), not a real device resource
296296
// Index is assigned in ascending order (1, 2, 3, ...) via distributed lock (leader election)
297-
// index := m.assignDeviceAllocationIndex(ctx, pod)
298-
// log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name)
297+
index := m.assignDeviceAllocationIndex(ctx, pod)
298+
log.FromContext(ctx).Info("assigned device allocation index successfully", "index", index, "pod", pod.Name)
299299

300300
for _, containerIndex := range containerIndices {
301301
container := &pod.Spec.Containers[containerIndex]

0 commit comments

Comments
 (0)