Skip to content

Commit

Permalink
Adjust test to use volumeMounts
Browse files Browse the repository at this point in the history
  • Loading branch information
peterghaddad committed Mar 14, 2023
1 parent c985a9e commit dcce201
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions ray-operator/controllers/ray/utils/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ func TestReconcile_CheckNeedRemoveOldPod(t *testing.T) {
Image: "rayproject/autoscaler",
Command: []string{"python"},
Args: []string{"/opt/code.py"},
Env: []corev1.EnvVar{
{
Name: "MY_POD_IP",
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "status.podIP",
},
},
},
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "MY_VOLUME_MOUNT",
Expand All @@ -172,10 +182,14 @@ func TestReconcile_CheckNeedRemoveOldPod(t *testing.T) {
Image: "rayproject/autoscaler",
Command: []string{"python"},
Args: []string{"/opt/code.py"},
VolumeMounts: []corev1.VolumeMount{
Env: []corev1.EnvVar{
{
Name: "MY_VOLUME_MOUNT",
MountPath: "/test/",
Name: "MY_POD_IP",
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "status.podIP",
},
},
},
},
},
Expand Down Expand Up @@ -213,14 +227,10 @@ func TestReconcile_CheckNeedRemoveOldPod(t *testing.T) {
Image: "rayproject/autoscaler",
Command: []string{"echo"},
Args: []string{"Hello Ray"},
Env: []corev1.EnvVar{
VolumeMounts: []corev1.VolumeMount{
{
Name: "MY_POD_IP",
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "status.podIP",
},
},
Name: "MY_VOLUME_MOUNT",
MountPath: "/test/",
},
},
},
Expand Down

0 comments on commit dcce201

Please sign in to comment.