From c2b7ed37d2f5568b7f5384e9b9d13755fdb619f4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 15 Jul 2023 04:44:25 +0800 Subject: [PATCH] [ctgmgr]: do not remove label when do systemd service stop when service is in kube mode (#15642) (#15846) --- src/sonic-ctrmgrd/ctrmgr/container | 2 +- src/sonic-ctrmgrd/tests/container_test.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/sonic-ctrmgrd/ctrmgr/container b/src/sonic-ctrmgrd/ctrmgr/container index 46af96ac3dd8..f3c8e171e288 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container +++ b/src/sonic-ctrmgrd/ctrmgr/container @@ -288,7 +288,7 @@ def container_stop(feature, **kwargs): set_owner, _ , _ = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) - remove_label = (remote_state != "pending") or (set_owner == "local") + remove_label = (set_owner == "local") debug_msg("{}: set_owner:{} current_owner:{} remote_state:{} docker_id:{}".format( feature, set_owner, current_owner, remote_state, docker_id)) diff --git a/src/sonic-ctrmgrd/tests/container_test.py b/src/sonic-ctrmgrd/tests/container_test.py index ad4a3a2f00b6..8866fdfa4a3d 100755 --- a/src/sonic-ctrmgrd/tests/container_test.py +++ b/src/sonic-ctrmgrd/tests/container_test.py @@ -244,11 +244,6 @@ "container_id": "", "container_version": "20201230.1.15" } - }, - common_test.KUBE_LABEL_TABLE: { - "SET": { - "snmp_enabled": "false" - } } } },