Skip to content

Commit 0deaf12

Browse files
authoredFeb 20, 2024
Merge pull request #123044 from yanhuan0802/fix-incorrect-comment
fix: correct incorrect comment & function name about SchedulingGated
2 parents 0f7cc6f + 01dbb85 commit 0deaf12

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎pkg/printers/internalversion/printers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ func printPod(pod *api.Pod, options printers.GenerateOptions) ([]metav1.TableRow
836836
reason = pod.Status.Reason
837837
}
838838

839-
// If the Pod carries {type:PodScheduled, reason:WaitingForGates}, set reason to 'SchedulingGated'.
839+
// If the Pod carries {type:PodScheduled, reason:SchedulingGated}, set reason to 'SchedulingGated'.
840840
for _, condition := range pod.Status.Conditions {
841841
if condition.Type == api.PodScheduled && condition.Reason == apiv1.PodReasonSchedulingGated {
842842
reason = apiv1.PodReasonSchedulingGated

‎pkg/printers/internalversion/printers_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ func TestPrintPod(t *testing.T) {
15061506
[]metav1.TableRow{{Cells: []interface{}{"test14", "2/2", "Running", "9 (5d ago)", "<unknown>"}}},
15071507
},
15081508
{
1509-
// Test PodScheduled condition with reason WaitingForGates
1509+
// Test PodScheduled condition with reason SchedulingGated
15101510
api.Pod{
15111511
ObjectMeta: metav1.ObjectMeta{Name: "test15"},
15121512
Spec: api.PodSpec{Containers: make([]api.Container, 2)},

‎pkg/registry/core/pod/strategy.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (podStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
8989

9090
podutil.DropDisabledPodFields(pod, nil)
9191

92-
applyWaitingForSchedulingGatesCondition(pod)
92+
applySchedulingGatedCondition(pod)
9393
mutatePodAffinity(pod)
9494
}
9595

@@ -737,9 +737,9 @@ func mutatePodAffinity(pod *api.Pod) {
737737
}
738738
}
739739

740-
// applyWaitingForSchedulingGatesCondition adds a {type:PodScheduled, reason:WaitingForGates} condition
740+
// applySchedulingGatedCondition adds a {type:PodScheduled, reason:SchedulingGated} condition
741741
// to a new-created Pod if necessary.
742-
func applyWaitingForSchedulingGatesCondition(pod *api.Pod) {
742+
func applySchedulingGatedCondition(pod *api.Pod) {
743743
if !utilfeature.DefaultFeatureGate.Enabled(features.PodSchedulingReadiness) ||
744744
len(pod.Spec.SchedulingGates) == 0 {
745745
return

‎pkg/registry/core/pod/strategy_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func TestGetPodQOS(t *testing.T) {
312312
}
313313
}
314314

315-
func TestWaitingForGatesCondition(t *testing.T) {
315+
func TestSchedulingGatedCondition(t *testing.T) {
316316
tests := []struct {
317317
name string
318318
pod *api.Pod

0 commit comments

Comments
 (0)