mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 08:55:40 +00:00
fix: k8s 支持网关
This commit is contained in:
@@ -22,7 +22,12 @@ class KubernetesClient:
|
|||||||
@property
|
@property
|
||||||
def api(self):
|
def api(self):
|
||||||
configuration = client.Configuration()
|
configuration = client.Configuration()
|
||||||
configuration.host = self.url
|
scheme = urlparse(self.url).scheme
|
||||||
|
if not self.server:
|
||||||
|
host = self.url
|
||||||
|
else:
|
||||||
|
host = f'{scheme}://127.0.0.1:{self.server.local_bind_port}'
|
||||||
|
configuration.host = host
|
||||||
configuration.verify_ssl = False
|
configuration.verify_ssl = False
|
||||||
configuration.api_key = {"authorization": "Bearer " + self.token}
|
configuration.api_key = {"authorization": "Bearer " + self.token}
|
||||||
c = api_client.ApiClient(configuration=configuration)
|
c = api_client.ApiClient(configuration=configuration)
|
||||||
|
Reference in New Issue
Block a user