mirror of https://github.com/milvus-io/milvus.git
[test]fix k8s client init (#19590)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com> Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>pull/19599/head
parent
ccecd6a76a
commit
58a9f260ad
|
@ -27,7 +27,7 @@ def init_k8s_client_config():
|
|||
|
||||
|
||||
def get_current_namespace():
|
||||
config.load_kube_config()
|
||||
init_k8s_client_config()
|
||||
ns = config.list_kube_config_contexts()[1]["context"]["namespace"]
|
||||
return ns
|
||||
|
||||
|
@ -188,7 +188,7 @@ def get_milvus_instance_name(namespace, host="127.0.0.1", port="19530", milvus_s
|
|||
ip_name_pairs = get_pod_ip_name_pairs(namespace, "app.kubernetes.io/name=milvus")
|
||||
pod_name = ip_name_pairs[query_node_ip]
|
||||
|
||||
config.load_kube_config()
|
||||
init_k8s_client_config()
|
||||
api_instance = client.CoreV1Api()
|
||||
try:
|
||||
api_response = api_instance.read_namespaced_pod(namespace=namespace, name=pod_name)
|
||||
|
@ -214,7 +214,7 @@ def get_milvus_deploy_tool(namespace, milvus_sys):
|
|||
query_node_ip = ms.query_nodes[0]["infos"]['hardware_infos']["ip"].split(":")[0]
|
||||
ip_name_pairs = get_pod_ip_name_pairs(namespace, "app.kubernetes.io/name=milvus")
|
||||
pod_name = ip_name_pairs[query_node_ip]
|
||||
config.load_kube_config()
|
||||
init_k8s_client_config()
|
||||
api_instance = client.CoreV1Api()
|
||||
try:
|
||||
api_response = api_instance.read_namespaced_pod(namespace=namespace, name=pod_name)
|
||||
|
|
|
@ -10,6 +10,7 @@ import requests
|
|||
from sklearn import preprocessing
|
||||
from pymilvus import Milvus, DataType
|
||||
from utils.util_log import test_log as log
|
||||
from utils.util_k8s import init_k8s_client_config
|
||||
|
||||
port = 19530
|
||||
epsilon = 0.000001
|
||||
|
@ -857,7 +858,7 @@ def restart_server(helm_release_name):
|
|||
client.rest.logger.setLevel(log.WARNING)
|
||||
|
||||
# service_name = "%s.%s.svc.cluster.local" % (helm_release_name, namespace)
|
||||
config.load_kube_config()
|
||||
init_k8s_client_config()
|
||||
v1 = client.CoreV1Api()
|
||||
pod_name = None
|
||||
# config_map_names = v1.list_namespaced_config_map(namespace, pretty='true')
|
||||
|
|
Loading…
Reference in New Issue