diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index d1af9938..d6a8be8c 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -7,6 +7,7 @@ on: push: branches: - master + env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true diff --git a/common/ssh_client/kubernetes_client.py b/common/ssh_client/kubernetes_client.py index 14c169de..251ab839 100644 --- a/common/ssh_client/kubernetes_client.py +++ b/common/ssh_client/kubernetes_client.py @@ -30,8 +30,10 @@ def __init__(self, context=None, node=None): self.container_name = self.node.get("container_name") or "observer" config_file = self.node.get("kubernetes_config_file") if config_file is None or config_file == "": - config.load_kube_config() + context.stdio.verbose("KubernetesClient load_kube_config from default config file in cluster.") + config.load_incluster_config() else: + context.stdio.verbose("KubernetesClient load_kube_config from {0}".format(config_file)) config.kube_config.load_kube_config(config_file=config_file) self.client = client.CoreV1Api() except Exception as e: diff --git a/common/ssh_client/ssh.py b/common/ssh_client/ssh.py index a78e9e6f..92fa949e 100644 --- a/common/ssh_client/ssh.py +++ b/common/ssh_client/ssh.py @@ -35,10 +35,13 @@ def __init__(self, context=None, node=None): def local_ip(self): local_ip_list = [] - hostname = socket.gethostname() - addresses = socket.getaddrinfo(hostname, None) - for address in addresses: - local_ip_list.append(address[4][0]) + try: + hostname = socket.gethostname() + addresses = socket.getaddrinfo(hostname, None) + for address in addresses: + local_ip_list.append(address[4][0]) + except Exception as e: + self.stdio.watn("get local ip warn: {} . Set local_ip is 127.0.0.1".format(e)) local_ip_list.append('127.0.0.1') return list(set(local_ip_list))