mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
fix: correct incorrect comment & function name about SchedulingGated
This commit is contained in:
parent
4f910fe47c
commit
01dbb85974
@ -836,7 +836,7 @@ func printPod(pod *api.Pod, options printers.GenerateOptions) ([]metav1.TableRow
|
||||
reason = pod.Status.Reason
|
||||
}
|
||||
|
||||
// If the Pod carries {type:PodScheduled, reason:WaitingForGates}, set reason to 'SchedulingGated'.
|
||||
// If the Pod carries {type:PodScheduled, reason:SchedulingGated}, set reason to 'SchedulingGated'.
|
||||
for _, condition := range pod.Status.Conditions {
|
||||
if condition.Type == api.PodScheduled && condition.Reason == apiv1.PodReasonSchedulingGated {
|
||||
reason = apiv1.PodReasonSchedulingGated
|
||||
|
@ -1506,7 +1506,7 @@ func TestPrintPod(t *testing.T) {
|
||||
[]metav1.TableRow{{Cells: []interface{}{"test14", "2/2", "Running", "9 (5d ago)", "<unknown>"}}},
|
||||
},
|
||||
{
|
||||
// Test PodScheduled condition with reason WaitingForGates
|
||||
// Test PodScheduled condition with reason SchedulingGated
|
||||
api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "test15"},
|
||||
Spec: api.PodSpec{Containers: make([]api.Container, 2)},
|
||||
|
@ -89,7 +89,7 @@ func (podStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
|
||||
|
||||
podutil.DropDisabledPodFields(pod, nil)
|
||||
|
||||
applyWaitingForSchedulingGatesCondition(pod)
|
||||
applySchedulingGatedCondition(pod)
|
||||
mutatePodAffinity(pod)
|
||||
}
|
||||
|
||||
@ -737,9 +737,9 @@ func mutatePodAffinity(pod *api.Pod) {
|
||||
}
|
||||
}
|
||||
|
||||
// applyWaitingForSchedulingGatesCondition adds a {type:PodScheduled, reason:WaitingForGates} condition
|
||||
// applySchedulingGatedCondition adds a {type:PodScheduled, reason:SchedulingGated} condition
|
||||
// to a new-created Pod if necessary.
|
||||
func applyWaitingForSchedulingGatesCondition(pod *api.Pod) {
|
||||
func applySchedulingGatedCondition(pod *api.Pod) {
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.PodSchedulingReadiness) ||
|
||||
len(pod.Spec.SchedulingGates) == 0 {
|
||||
return
|
||||
|
@ -312,7 +312,7 @@ func TestGetPodQOS(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWaitingForGatesCondition(t *testing.T) {
|
||||
func TestSchedulingGatedCondition(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
pod *api.Pod
|
||||
|
Loading…
Reference in New Issue
Block a user