Skip to content

Commit 4836d01

Browse files
authored
[Refactor] Renaming RayHttpProxyClient attribute UseProxy #1980 (#2093)
1 parent e02751a commit 4836d01

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ type BaseDashboardClient struct {
5050
dashboardURL string
5151
}
5252

53-
func GetRayDashboardClientFunc(mgr ctrl.Manager, useProxy bool) func() RayDashboardClientInterface {
53+
func GetRayDashboardClientFunc(mgr ctrl.Manager, useKubernetesProxy bool) func() RayDashboardClientInterface {
5454
return func() RayDashboardClientInterface {
5555
return &RayDashboardClient{
56-
mgr: mgr,
57-
useProxy: useProxy,
56+
mgr: mgr,
57+
useKubernetesProxy: useKubernetesProxy,
5858
}
5959
}
6060
}
6161

6262
type RayDashboardClient struct {
6363
BaseDashboardClient
6464

65-
mgr ctrl.Manager
66-
useProxy bool
65+
mgr ctrl.Manager
66+
useKubernetesProxy bool
6767
}
6868

6969
// FetchHeadServiceURL fetches the URL that consists of the FQDN for the RayCluster's head service
@@ -112,7 +112,7 @@ func FetchHeadServiceURL(ctx context.Context, cli client.Client, rayCluster *ray
112112
func (r *RayDashboardClient) InitClient(ctx context.Context, url string, rayCluster *rayv1.RayCluster) error {
113113
log := ctrl.LoggerFrom(ctx)
114114

115-
if r.useProxy {
115+
if r.useKubernetesProxy {
116116
var err error
117117
headSvcName := rayCluster.Status.Head.ServiceName
118118
if headSvcName == "" {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ type RayHttpProxyClientInterface interface {
1616
SetHostIp(hostIp, podNamespace, podName string, port int)
1717
}
1818

19-
func GetRayHttpProxyClientFunc(mgr ctrl.Manager, useProxy bool) func() RayHttpProxyClientInterface {
19+
func GetRayHttpProxyClientFunc(mgr ctrl.Manager, useKubernetesProxy bool) func() RayHttpProxyClientInterface {
2020
return func() RayHttpProxyClientInterface {
2121
return &RayHttpProxyClient{
22-
mgr: mgr,
23-
useProxy: useProxy,
22+
mgr: mgr,
23+
useKubernetesProxy: useKubernetesProxy,
2424
}
2525
}
2626
}
@@ -29,8 +29,8 @@ type RayHttpProxyClient struct {
2929
client *http.Client
3030
httpProxyURL string
3131

32-
mgr ctrl.Manager
33-
useProxy bool
32+
mgr ctrl.Manager
33+
useKubernetesProxy bool
3434
}
3535

3636
func (r *RayHttpProxyClient) InitClient() {
@@ -40,7 +40,7 @@ func (r *RayHttpProxyClient) InitClient() {
4040
}
4141

4242
func (r *RayHttpProxyClient) SetHostIp(hostIp, podNamespace, podName string, port int) {
43-
if r.useProxy {
43+
if r.useKubernetesProxy {
4444
r.client = r.mgr.GetHTTPClient()
4545
r.httpProxyURL = fmt.Sprintf("%s/api/v1/namespaces/%s/pods/%s:%d/proxy/", r.mgr.GetConfig().Host, podNamespace, podName, port)
4646
}

0 commit comments

Comments
 (0)