From 17948d0e4cccb0095fec1bfc385c815eb2e1c2c8 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Mon, 13 Sep 2021 16:47:56 +0800 Subject: [PATCH] [docker-orchagent][201911] Pass ASIC vendor information to swss docker as docker level environment variable (#8274) #### Why I did it Recently, the reserved buffer of admin-down ports is going to be reclaimed. However, the way to do this differs among vendors. We need to find a way to pass vendor information to swss docker. #### How I did it Fetch the ASIC vendor information when the docker is created and pass it to the docker as environment variable `ASIC_VENDOR`. --- files/build_templates/docker_image_ctl.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 3ab779a3b0c3..bcef8f901e77 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -335,6 +335,9 @@ start() { -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ {%- endif %} {%- endif %} +{%- if docker_container_name == "swss" %} + -e ASIC_VENDOR={{ sonic_asic_platform }} \ +{%- endif %} {%- if docker_container_name == "bgp" %} -v /etc/sonic/frr/$DEV:/etc/frr:rw \ {%- endif %}