Skip to content

Commit

Permalink
Fixed linter error from gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansito committed Feb 13, 2024
1 parent c0eebe5 commit c29da9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions gateway/api/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ def create_ray_cluster(
config.load_incluster_config()
k8s_client = kubernetes_client.api_client.ApiClient()
dyn_client = DynamicClient(k8s_client)
raycluster_client = dyn_client.resources.get(
api_version="v1", kind="RayCluster"
)
raycluster_client = dyn_client.resources.get(api_version="v1", kind="RayCluster")
response = raycluster_client.create(body=cluster_data, namespace=namespace)
if response.metadata.name != cluster_name:
raise RuntimeError(
Expand Down Expand Up @@ -287,9 +285,7 @@ def kill_ray_cluster(cluster_name: str) -> bool:
config.load_incluster_config()
k8s_client = kubernetes_client.api_client.ApiClient()
dyn_client = DynamicClient(k8s_client)
raycluster_client = dyn_client.resources.get(
api_version="v1", kind="RayCluster"
)
raycluster_client = dyn_client.resources.get(api_version="v1", kind="RayCluster")
try:
delete_response = raycluster_client.delete(
name=cluster_name, namespace=namespace
Expand Down
4 changes: 1 addition & 3 deletions gateway/tests/api/test_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def test_kill_cluster(self):

success = kill_ray_cluster("some_cluster")
self.assertTrue(success)
DynamicClient.resources.get.assert_any_call(
api_version="v1", kind="RayCluster"
)
DynamicClient.resources.get.assert_any_call(api_version="v1", kind="RayCluster")
DynamicClient.resources.get.assert_any_call(
api_version="v1", kind="Certificate"
)
Expand Down

0 comments on commit c29da9e

Please sign in to comment.