Skip to content

Commit 3e88985

Browse files
committed
lint
Signed-off-by: Spencer Peterson <spencerjp@google.com>
1 parent 73491b8 commit 3e88985

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ray-operator/controllers/ray/utils/util_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func createSomePodWithCondition(typ corev1.PodConditionType, status corev1.Condi
328328
}
329329
}
330330

331-
func createRayHeadPodWithPhaseAndCondition(phase corev1.PodPhase, typ corev1.PodConditionType, status corev1.ConditionStatus) (pod *corev1.Pod) {
331+
func createRayHeadPodWithPhaseAndCondition(phase corev1.PodPhase, status corev1.ConditionStatus) (pod *corev1.Pod) {
332332
return &corev1.Pod{
333333
TypeMeta: metav1.TypeMeta{
334334
APIVersion: "v1",
@@ -345,7 +345,7 @@ func createRayHeadPodWithPhaseAndCondition(phase corev1.PodPhase, typ corev1.Pod
345345
Phase: phase,
346346
Conditions: []corev1.PodCondition{
347347
{
348-
Type: typ,
348+
Type: corev1.PodReady,
349349
Status: status,
350350
},
351351
},
@@ -945,23 +945,23 @@ func TestFindHeadPodReadyCondition(t *testing.T) {
945945
}{
946946
{
947947
name: "condition true if Ray head pod is running and ready",
948-
pod: createRayHeadPodWithPhaseAndCondition(corev1.PodRunning, corev1.PodReady, corev1.ConditionTrue),
948+
pod: createRayHeadPodWithPhaseAndCondition(corev1.PodRunning, corev1.ConditionTrue),
949949
expected: metav1.Condition{
950950
Type: string(rayv1.HeadPodReady),
951951
Status: metav1.ConditionTrue,
952952
},
953953
},
954954
{
955955
name: "condition false if Ray head pod is not running",
956-
pod: createRayHeadPodWithPhaseAndCondition(corev1.PodPending, corev1.PodReady, corev1.ConditionFalse),
956+
pod: createRayHeadPodWithPhaseAndCondition(corev1.PodPending, corev1.ConditionFalse),
957957
expected: metav1.Condition{
958958
Type: string(rayv1.HeadPodReady),
959959
Status: metav1.ConditionFalse,
960960
},
961961
},
962962
{
963963
name: "condition false if Ray head pod is not ready",
964-
pod: createRayHeadPodWithPhaseAndCondition(corev1.PodRunning, corev1.PodReady, corev1.ConditionFalse),
964+
pod: createRayHeadPodWithPhaseAndCondition(corev1.PodRunning, corev1.ConditionFalse),
965965
expected: metav1.Condition{
966966
Type: string(rayv1.HeadPodReady),
967967
Status: metav1.ConditionFalse,
@@ -981,8 +981,8 @@ func TestFindHeadPodReadyMessage(t *testing.T) {
981981
tests := []struct {
982982
name string
983983
message string
984-
status []corev1.ContainerStatus
985984
expectedMessage string
985+
status []corev1.ContainerStatus
986986
}{{
987987
name: "no message no status want nothing",
988988
}, {
@@ -1039,7 +1039,7 @@ func TestFindHeadPodReadyMessage(t *testing.T) {
10391039

10401040
for _, tc := range tests {
10411041
t.Run(tc.name, func(t *testing.T) {
1042-
pod := createRayHeadPodWithPhaseAndCondition(corev1.PodPending, corev1.PodReady, corev1.ConditionFalse)
1042+
pod := createRayHeadPodWithPhaseAndCondition(corev1.PodPending, corev1.ConditionFalse)
10431043
pod.Status.Conditions[0].Message = tc.message
10441044
pod.Status.ContainerStatuses = tc.status
10451045
cond := FindHeadPodReadyCondition(pod)

0 commit comments

Comments
 (0)