Skip to content

Commit 75dfe3b

Browse files
committed
move schedulername from schedulerbackend to pclq controller
Signed-off-by: kangclzjc <[email protected]>
1 parent 0fe719f commit 75dfe3b

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

operator/internal/controller/podclique/components/pod/pod.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ func (r _resource) buildResource(pcs *grovecorev1alpha1.PodCliqueSet, pclq *grov
161161
}
162162
pod.Spec = *pclq.Spec.PodSpec.DeepCopy()
163163
pod.Spec.SchedulingGates = []corev1.PodSchedulingGate{{Name: podGangSchedulingGate}}
164+
pod.Spec.SchedulerName = schedulerbackend.Get().Name()
164165

165166
// Use backend to prepare Pod spec based on scheduler requirements
166-
// This adds schedulerName, scheduling gates, annotations, etc.
167+
// This adds labels, annotations, etc.
167168
if err = schedulerbackend.PreparePod(pod); err != nil {
168169
return groveerr.WrapError(err,
169170
errCodeBuildPodResource,

operator/internal/schedulerbackend/kai/backend.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ func (b *Backend) OnPodGangDelete(_ context.Context, _ *groveschedulerv1alpha1.P
8383
}
8484

8585
// PreparePod adds KAI scheduler-specific configuration to the Pod
86-
// This includes: schedulerName, and annotations
86+
// This includes: labels, annotations, etc.
8787
func (b *Backend) PreparePod(pod *corev1.Pod) {
88-
// Set scheduler name from configuration
89-
pod.Spec.SchedulerName = SchedulerName
9088
}

operator/internal/schedulerbackend/kube/backend.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ func (b *Backend) OnPodGangDelete(_ context.Context, _ *groveschedulerv1alpha1.P
7474
}
7575

7676
// PreparePod adds Kubernetes default scheduler-specific configuration to the Pod
77-
// This simply sets the scheduler name
77+
// This includes: labels, annotations, etc.
7878
func (b *Backend) PreparePod(pod *corev1.Pod) {
79-
// Set scheduler name from configuration
80-
pod.Spec.SchedulerName = SchedulerName
8179
}

0 commit comments

Comments
 (0)