@@ -21,28 +21,35 @@ import (
21
21
22
22
"github.com/onsi/gomega"
23
23
24
- corev1 "k8s.io/api/core/v1"
25
24
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26
25
27
26
rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
28
27
)
29
28
30
29
const RayJobDefaultClusterSelectorKey = "ray.io/cluster"
31
30
32
- func RayJob (t Test , namespace * corev1. Namespace , name string ) func (g gomega.Gomega ) * rayv1alpha1.RayJob {
31
+ func RayJob (t Test , namespace , name string ) func (g gomega.Gomega ) * rayv1alpha1.RayJob {
33
32
return func (g gomega.Gomega ) * rayv1alpha1.RayJob {
34
- job , err := t .Client ().Ray ().RayV1alpha1 ().RayJobs (namespace . Name ).Get (t .Ctx (), name , metav1.GetOptions {})
33
+ job , err := t .Client ().Ray ().RayV1alpha1 ().RayJobs (namespace ).Get (t .Ctx (), name , metav1.GetOptions {})
35
34
g .Expect (err ).NotTo (gomega .HaveOccurred ())
36
35
return job
37
36
}
38
37
}
39
38
39
+ func GetRayJob (t Test , namespace , name string ) * rayv1alpha1.RayJob {
40
+ t .T ().Helper ()
41
+ return RayJob (t , namespace , name )(t )
42
+ }
43
+
40
44
func RayJobStatus (job * rayv1alpha1.RayJob ) rayv1alpha1.JobStatus {
41
45
return job .Status .JobStatus
42
46
}
43
47
44
- func GetRayJobLogs (t Test , job * rayv1alpha1. RayJob ) string {
48
+ func GetRayJobLogs (t Test , namespace , name string ) string {
45
49
t .T ().Helper ()
50
+
51
+ job := GetRayJob (t , namespace , name )
52
+
46
53
response := t .Client ().Core ().CoreV1 ().RESTClient ().
47
54
Get ().
48
55
AbsPath ("/api/v1/namespaces" , job .Namespace , "services" , "http:" + job .Status .RayClusterName + "-head-svc:dashboard" , "proxy" , "api" , "jobs" , job .Status .JobId , "logs" ).
0 commit comments