From ee04f4afc8e031a9ae37ce540ffa8c0cd38343b3 Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 26 May 2025 18:56:18 +0800 Subject: [PATCH] fix: fix issue with add node do not restart docker (#8838) --- agent/app/service/docker.go | 2 +- frontend/src/api/interface/setting.ts | 4 ++-- frontend/src/views/setting/license/bind/xpack.vue | 3 +-- frontend/src/views/setting/license/index.vue | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/agent/app/service/docker.go b/agent/app/service/docker.go index 11ca1b32f..8ac011947 100644 --- a/agent/app/service/docker.go +++ b/agent/app/service/docker.go @@ -147,7 +147,6 @@ func (u *DockerService) UpdateConf(req dto.SettingUpdate, withRestart bool) erro } daemonMap := make(map[string]interface{}) _ = json.Unmarshal(file, &daemonMap) - switch req.Key { case "Registries": req.Value = strings.TrimSuffix(req.Value, ",") @@ -480,6 +479,7 @@ func getDockerRestartCommand() (string, error) { } func restartDocker() error { + global.LOG.Info("restart docker") restartCmd, err := getDockerRestartCommand() if err != nil { return err diff --git a/frontend/src/api/interface/setting.ts b/frontend/src/api/interface/setting.ts index a9f096d8d..ea760ca51 100644 --- a/frontend/src/api/interface/setting.ts +++ b/frontend/src/api/interface/setting.ts @@ -245,11 +245,11 @@ export namespace Setting { nodeID: number; licenseID: number; syncList: string; - withRestartDocker: boolean; + withDockerRestart: boolean; } export interface LicenseUnbind { id: number; force: boolean; - withRestartDocker: boolean; + withDockerRestart: boolean; } } diff --git a/frontend/src/views/setting/license/bind/xpack.vue b/frontend/src/views/setting/license/bind/xpack.vue index 877214278..984ea5303 100644 --- a/frontend/src/views/setting/license/bind/xpack.vue +++ b/frontend/src/views/setting/license/bind/xpack.vue @@ -95,12 +95,11 @@ const onBind = async (formEl: FormInstance | undefined) => { const submit = async () => { loading.value = true; - console.log(withDockerRestart.value); await bindLicense({ licenseID: form.licenseID, nodeID: form.nodeID, syncList: form.syncList, - withRestartDocker: withDockerRestart.value, + withDockerRestart: withDockerRestart.value, }) .then(() => { loading.value = false; diff --git a/frontend/src/views/setting/license/index.vue b/frontend/src/views/setting/license/index.vue index 4a2a6b9b7..c123c81a9 100644 --- a/frontend/src/views/setting/license/index.vue +++ b/frontend/src/views/setting/license/index.vue @@ -192,7 +192,7 @@ const submitUnbind = async () => { await unbindLicense({ id: unbindRow.value.id, force: forceUnbind.value, - withRestartDocker: withDockerRestart.value, + withDockerRestart: withDockerRestart.value, }) .then(() => { loading.value = false;