-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update container_checker for multi-asic devices when state is 'always_enabled' #10067
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ def get_expected_running_containers(): | |
|
||
expected_running_containers = set() | ||
always_running_containers = set() | ||
|
||
for container_name in feature_table.keys(): | ||
if feature_table[container_name]["state"] not in ["disabled", "always_disabled"]: | ||
if multi_asic.is_multi_asic(): | ||
|
@@ -51,14 +51,20 @@ def get_expected_running_containers(): | |
num_asics = multi_asic.get_num_asics() | ||
for asic_id in range(num_asics): | ||
expected_running_containers.add(container_name + str(asic_id)) | ||
elif feature_table[container_name]["state"] == 'always_enabled': | ||
always_running_containers.add(container_name) | ||
else: | ||
expected_running_containers.add(container_name) | ||
|
||
if feature_table[container_name]["state"] == 'always_enabled': | ||
if multi_asic.is_multi_asic(): | ||
if feature_table[container_name]["has_global_scope"] == "True": | ||
always_running_containers.add(container_name) | ||
if feature_table[container_name]["has_per_asic_scope"] == "True": | ||
num_asics = multi_asic.get_num_asics() | ||
for asic_id in range(num_asics): | ||
always_running_containers.add(container_name + str(asic_id)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please verify that indeed the container is running? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Renuka, |
||
else: | ||
always_running_containers.add(container_name) | ||
return expected_running_containers, always_running_containers | ||
|
||
|
||
def get_current_running_from_DB(always_running_containers): | ||
""" | ||
@summary: This function will get the current running container list | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_global_scope -- Is this true only for Database container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_global_scope is True for other containers e.g. lldp, dhcp_relay, mux, etc
but here the if statement is under "if feature_table[container_name]["state"] == 'always_enabled'", which is only True for mux and databse, while mux doesn't seem to be a container as shown in 'docker ps -a'
Feature State AutoRestart SystemState UpdateTime ContainerId Version SetOwner CurrentOwner RemoteState
acms enabled enabled up 2022-02-22 19:20:47 acms local local none
bgp enabled enabled local
database always_enabled always_enabled local
dhcp_relay enabled enabled up 2022-02-22 19:21:10 dhcp_relay 20201231.54 kube local
lldp enabled enabled up 2022-02-22 19:20:53 lldp 20201231.54 kube local
mux always_disabled enabled local
pmon enabled enabled up 2022-02-22 19:20:48 pmon 20201231.54 kube local
radv enabled enabled up 2022-02-22 19:21:06 radv 20201231.54 kube local
restapi enabled enabled up 2022-02-22 19:20:47 restapi local local none
snmp enabled enabled up 2022-02-22 19:23:56 snmp 20201231.54 kube local
swss enabled enabled local
syncd enabled enabled local
teamd enabled enabled local
telemetry enabled enabled up 2022-02-22 19:23:59 telemetry 20201231.54 kube local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous code on line 54 and 55 will add container with 'state' as 'always_enabled' to always_running_containers only if single-asic. I moved that condition one upper level, and let it decide separately for multi-asic and single-asic.