Change:
<!-- This form is for bug reports and feature requests ONLY! If you're looking for help check and the . If the matter is security related, please disclose it privately via --Is this a BUG REPORT or FEATURE REQUEST?: What happened: Create a DaemonSet. It'll create pods with schedulerName=default-scheduler. However, the DaemonSet pods aren't actually scheduled by default-scheduler but DaemonSet controller.
If the "schedulerName" is empty, apiserver will set the default value to "default-scheduler". To avoid the confusion, I think we can let DaemonSet set this field (for example 'ds-controller') when creating the DaemonSet pods, WDYT?
What's "schdulerName" for? Is it just for telling the users who scheduled this pod, or is this information used by other resources in the system? Also, I'd expect this field to be set by schedulers. Why is it not set by default scheduler, but apiserver? How does apiserver know which scheduler does the work, if there are more than one? Letting DaemonSet controller set this field sounds reasonable, as DaemonSet controller is the "scheduler".
is introduced by multi-scheduler; a common case is to set it by user in : it means this Pod should be scheduled by specific scheduler. In each scheduler (including the default scheduler), it will check whether it's responsible for the pending Pod. The default value is default scheduler :) Sure, I'll open a PR for this :)
/assign
Isn't scheduler name ignored when spec.nodeName is set?
no, right now; that makes sense, I'll also include this in PR :)
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
Stale issues rot after 30d of inactivity. Mark the issue as fresh with . Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle rotten
/remove-lifecycle rotten
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale

Discussion:
defer createWait.Done() var err error <del> podTemplate := &template </del> <ins> podTemplate := template.DeepCopy() </ins> if utilfeature.DefaultFeatureGate.Enabled(features.ScheduleDaemonSetPods) { <del> podTemplate = template.DeepCopy() </del> // The pod's NodeAffinity will be updated to make sure the Pod is bound // to the target node by default scheduler. It is safe to do so because there // should be no conflicting node affinity with the target node.

err = dsc.podControl.CreatePodsWithControllerRef(ds.Namespace, podTemplate, ds, metav1.NewControllerRef(ds, controllerKind)) } else { <ins> // If pod is scheduled by DaemonSetController, set its '.spec.scheduleName'. podTemplate.Spec.SchedulerName = "kubernetes.io/daemonset-controller" </ins> err = dsc.podControl.CreatePodsOnNode(nodesNeedingDaemonPods[ix], ds.Namespace, podTemplate, ds, metav1.NewControllerRef(ds, controllerKind)) }