Skip to content

Commit

Permalink
Merge pull request #264 from wangyizhi1/main
Browse files Browse the repository at this point in the history
fix: the pod with a custom scheduler cannot be started
  • Loading branch information
kosmos-robot authored Nov 20, 2023
2 parents e61b8f2 + 3162b0d commit 79d4c65
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var SYNC_GVRS = []schema.GroupVersionResource{utils.GVR_CONFIGMAP, utils.GVR_SEC
var SYNC_OBJS = []client.Object{&corev1.ConfigMap{}, &corev1.Secret{}}

const SYNC_KIND_CONFIGMAP = "ConfigMap"
const SYNC_KIND_SECRET = "SECRET"
const SYNC_KIND_SECRET = "Secret"

type SyncResourcesReconciler struct {
GroupVersionResource schema.GroupVersionResource
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
DefaultWaitTime = 120
RootClusterAnnotationKey = "kosmos.io/cluster-role"
RootClusterAnnotationValue = "root"
KosmosSchedulerName = "kosmos-scheduler"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion pkg/utils/podutils/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ func FitPod(pod *corev1.Pod, ignoreLabels []string, cleanNodeName bool) *corev1.
podCopy.Spec.Volumes = vols
podCopy.Status = corev1.PodStatus{}

podCopy.Spec.SchedulerName = ""
if podCopy.Spec.SchedulerName == utils.KosmosSchedulerName {
podCopy.Spec.SchedulerName = ""
}

if cleanNodeName {
podCopy.Spec.NodeName = ""
Expand Down

0 comments on commit 79d4c65

Please sign in to comment.