From 45e8f235882508a032df0321ecf66d54c9b6242f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Fri, 5 Jul 2024 15:30:57 +0800 Subject: [PATCH 01/10] fix KubernetesClient --- common/ssh_client/kubernetes_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ssh_client/kubernetes_client.py b/common/ssh_client/kubernetes_client.py index d6bc6ea9..14c169de 100644 --- a/common/ssh_client/kubernetes_client.py +++ b/common/ssh_client/kubernetes_client.py @@ -30,7 +30,7 @@ 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.kube_config.load_kube_config() + config.load_kube_config() else: config.kube_config.load_kube_config(config_file=config_file) self.client = client.CoreV1Api() From 92b89048bf4874ee8a8aa8da0c306883c50fec78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Fri, 5 Jul 2024 18:09:26 +0800 Subject: [PATCH 02/10] fix KubernetesClient --- common/ssh_client/kubernetes_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/ssh_client/kubernetes_client.py b/common/ssh_client/kubernetes_client.py index 14c169de..878f8611 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 == "": + context.stdio.verbose("KubernetesClient load_kube_config from default config file in cluster.") config.load_kube_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: From 2cec320f47d71bba6c9d434b2e99ab135404be33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Tue, 9 Jul 2024 10:33:27 +0800 Subject: [PATCH 03/10] fix KubernetesClient --- .github/workflows/build_package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index d1af9938..55bf36e4 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -7,6 +7,7 @@ on: push: branches: - master + - 2.3.0-qulei env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true From fecc4043d124a8dbb6a4296bee3ea99044d0a98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Tue, 9 Jul 2024 10:56:41 +0800 Subject: [PATCH 04/10] fix KubernetesClient --- common/ssh_client/kubernetes_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ssh_client/kubernetes_client.py b/common/ssh_client/kubernetes_client.py index 878f8611..251ab839 100644 --- a/common/ssh_client/kubernetes_client.py +++ b/common/ssh_client/kubernetes_client.py @@ -31,7 +31,7 @@ def __init__(self, context=None, node=None): config_file = self.node.get("kubernetes_config_file") if config_file is None or config_file == "": context.stdio.verbose("KubernetesClient load_kube_config from default config file in cluster.") - config.load_kube_config() + 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) From bfa4c30e966e698764809fbf7ec2bca312d6ad40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Tue, 9 Jul 2024 14:46:30 +0800 Subject: [PATCH 05/10] fix "nodename nor servname provided" --- common/ssh_client/ssh.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)) From b1b9f64fb9ebf723d1b108e48564b8ee5d730f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Tue, 9 Jul 2024 15:21:54 +0800 Subject: [PATCH 06/10] delete build tag --- .github/workflows/build_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index 55bf36e4..d6a8be8c 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -7,7 +7,7 @@ on: push: branches: - master - - 2.3.0-qulei + env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true From d77d3c5a9e36959ccccaf4fa1886bb09d8051c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Tue, 9 Jul 2024 17:56:23 +0800 Subject: [PATCH 07/10] fix ssh stdio print --- common/ssh_client/ssh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/ssh_client/ssh.py b/common/ssh_client/ssh.py index 92fa949e..d39c8a63 100644 --- a/common/ssh_client/ssh.py +++ b/common/ssh_client/ssh.py @@ -29,6 +29,9 @@ def __init__(self, context=None, node=None): raise Exception("SshHelper init error: node is None") self.node = node self.context = context + self.stdio = None + if self.context is not None: + self.stdio = self.context.stdio self.ssh_type = node.get("ssh_type") or "remote" self.client = None self.init() @@ -41,7 +44,8 @@ def local_ip(self): 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)) + if self.stdio is not None: + self.stdio.warn("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)) From d66ebf91960abb069d38a224f3269b3bab85def2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Wed, 10 Jul 2024 16:38:53 +0800 Subject: [PATCH 08/10] fix remote_client --- common/ssh_client/remote_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/ssh_client/remote_client.py b/common/ssh_client/remote_client.py index a24146fd..6bcfdaf6 100644 --- a/common/ssh_client/remote_client.py +++ b/common/ssh_client/remote_client.py @@ -42,7 +42,7 @@ def __init__(self, context, node): self._sftp_client = None self._disabled_rsa_algorithms = None self.host_ip = self.node.get("ip") - self.username = self.node.get("username") + self.username = self.node.get("ssh_username") self.ssh_port = self.node.get("ssh_port") self.need_password = True self.password = self.node.get("ssh_password") From 9d77f25da1e0390e406bf671d1822c677431a108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Wed, 10 Jul 2024 20:26:22 +0800 Subject: [PATCH 09/10] fix example operator.yml --- example/operator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/operator.yml b/example/operator.yml index 05c997ee..3409639f 100644 --- a/example/operator.yml +++ b/example/operator.yml @@ -29,7 +29,7 @@ obcluster: container_name: observer home_path: /home/admin/oceanbase data_dir: /home/admin/oceanbase/store - redo_Dir: /home/admin/oceanbase/store + redo_dir: /home/admin/oceanbase/store ip: xx.xx.xx.xx global: # if running obdiag in kubernetes, please delete the kubernetes_config_file From 848531e17ea7555e3ba1d375aed24ae4f9bab3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Mon, 15 Jul 2024 15:02:28 +0800 Subject: [PATCH 10/10] fix get_obproxy_version on rca --- handler/rca/rca_handler.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/handler/rca/rca_handler.py b/handler/rca/rca_handler.py index 51da1a95..993bd173 100644 --- a/handler/rca/rca_handler.py +++ b/handler/rca/rca_handler.py @@ -99,12 +99,7 @@ def __init__(self, context): obproxy_version = "" try: if len(context_obproxy_nodes) > 0: - obproxy_version = get_obproxy_version( - True, - context_obproxy_nodes[0]["ssher"], - context_obproxy_nodes[0]["home_path"], - self.stdio, - ) + obproxy_version = get_obproxy_version(context) except Exception as e: self.stdio.warn("RCAHandler.init Failed to get obproxy version. Error:{0}".format(e)) if obproxy_version != "":