From f558bc191d3ba8a8763ea021a670a6687e08fe6a Mon Sep 17 00:00:00 2001 From: zhangxinhui02 Date: Fri, 21 Nov 2025 02:30:58 +0800 Subject: [PATCH] =?UTF-8?q?change:=20=E4=BC=98=E5=8C=96helm=20chart?= =?UTF-8?q?=E7=9A=84k8s-init.sh=E5=92=8Ccore-webui-cm-sync.py=E7=9A=84?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm-chart/core-webui-cm-sync/core-webui-cm-sync.py | 5 +++-- helm-chart/files/k8s-init.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/helm-chart/core-webui-cm-sync/core-webui-cm-sync.py b/helm-chart/core-webui-cm-sync/core-webui-cm-sync.py index 8d39d1e7..49037f93 100644 --- a/helm-chart/core-webui-cm-sync/core-webui-cm-sync.py +++ b/helm-chart/core-webui-cm-sync/core-webui-cm-sync.py @@ -43,8 +43,8 @@ class ConfigObserverHandler(FileSystemEventHandler): """配置文件变化的事件处理器""" def on_modified(self, event): if os.path.abspath(event.src_path) in target_files: - print( - f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] File `{event.src_path}` was modified. Start to sync...') + print(f'[{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}] File `{event.src_path}` was modified. ' + f'Start to sync...') with open(event.src_path, "r", encoding="utf-8") as _f: current_data = _f.read() new_cm = { @@ -52,6 +52,7 @@ class ConfigObserverHandler(FileSystemEventHandler): } try: set_configmap(new_cm) + print(f'\tSync done.') except client.exceptions.ApiException as _e: print(f'\tError while setting configmap:\n' f'\t\tStatus Code: {_e.status}\n' diff --git a/helm-chart/files/k8s-init.sh b/helm-chart/files/k8s-init.sh index 0fc26dea..3729a68f 100644 --- a/helm-chart/files/k8s-init.sh +++ b/helm-chart/files/k8s-init.sh @@ -16,7 +16,7 @@ mkdir -p /MaiMBot/data/plugins mkdir -p /MaiMBot/data/logs if [ ! -d "/MaiMBot/statistics" ] then - echo "[K8s Init] Statistics volume disabled." + echo "[K8s Init] Statistics volume is disabled." else touch /MaiMBot/statistics/index.html fi @@ -47,7 +47,7 @@ then ln -s /MaiMBot/webui-cm-sync/bot_config.toml /MaiMBot/config/bot_config.toml echo "[K8s Init] Config files middle layer for WebUI created." else - echo "[K8s Init] WebUI disabled." + echo "[K8s Init] WebUI is disabled." fi # 启动麦麦