From 903b997073adfe0a511579d2a1dbbb7dd2185808 Mon Sep 17 00:00:00 2001 From: liuh-80 Date: Thu, 24 Oct 2024 06:05:25 +0000 Subject: [PATCH 1/3] Add VRF parameter to orchagent and GNMI start script. --- dockers/docker-orchagent/orchagent.sh | 6 ++++++ dockers/docker-sonic-gnmi/gnmi-native.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 705e1ea0db5d..256def591807 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -97,4 +97,10 @@ if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then fi fi +# Add VRF parameter when mgmt-vrf enabled +MGMT_VRF_ENABLED=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" "mgmtVrfEnabled"` +if [[ x"${MGMT_VRF_ENABLED}" == x"true" ]]; then + ORCHAGENT_ARGS+=" -v mgmt" +fi + exec /usr/bin/orchagent ${ORCHAGENT_ARGS} diff --git a/dockers/docker-sonic-gnmi/gnmi-native.sh b/dockers/docker-sonic-gnmi/gnmi-native.sh index e9f15810a226..659b5053652a 100755 --- a/dockers/docker-sonic-gnmi/gnmi-native.sh +++ b/dockers/docker-sonic-gnmi/gnmi-native.sh @@ -104,4 +104,10 @@ else fi fi +# Add VRF parameter when mgmt-vrf enabled +MGMT_VRF_ENABLED=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" "mgmtVrfEnabled"` +if [[ x"${MGMT_VRF_ENABLED}" == x"true" ]]; then + TELEMETRY_ARGS+=" -vrf=mgmt" +fi + exec /usr/sbin/telemetry ${TELEMETRY_ARGS} From 6484d3e49e9cdae31ee7cca68dd7c858dbf54e74 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:07:25 +0800 Subject: [PATCH 2/3] Update gnmi-native.sh --- dockers/docker-sonic-gnmi/gnmi-native.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dockers/docker-sonic-gnmi/gnmi-native.sh b/dockers/docker-sonic-gnmi/gnmi-native.sh index 659b5053652a..e9f15810a226 100755 --- a/dockers/docker-sonic-gnmi/gnmi-native.sh +++ b/dockers/docker-sonic-gnmi/gnmi-native.sh @@ -104,10 +104,4 @@ else fi fi -# Add VRF parameter when mgmt-vrf enabled -MGMT_VRF_ENABLED=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" "mgmtVrfEnabled"` -if [[ x"${MGMT_VRF_ENABLED}" == x"true" ]]; then - TELEMETRY_ARGS+=" -vrf=mgmt" -fi - exec /usr/sbin/telemetry ${TELEMETRY_ARGS} From 588b19f7e1ead3d01b5764564a28efb74e79fac5 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:53:44 +0800 Subject: [PATCH 3/3] Update gnmi-native.sh --- dockers/docker-sonic-gnmi/gnmi-native.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockers/docker-sonic-gnmi/gnmi-native.sh b/dockers/docker-sonic-gnmi/gnmi-native.sh index e9f15810a226..b9241dca1d6a 100755 --- a/dockers/docker-sonic-gnmi/gnmi-native.sh +++ b/dockers/docker-sonic-gnmi/gnmi-native.sh @@ -78,6 +78,12 @@ if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then TELEMETRY_ARGS+=" -zmq_port=8100" fi +# Add VRF parameter when mgmt-vrf enabled +MGMT_VRF_ENABLED=`sonic-db-cli CONFIG_DB hget "MGMT_VRF_CONFIG|vrf_global" "mgmtVrfEnabled"` +if [[ x"${MGMT_VRF_ENABLED}" == x"true" ]]; then + TELEMETRY_ARGS+=" --vrf mgmt" +fi + # Server will handle threshold connections consecutively THRESHOLD_CONNECTIONS=$(echo $GNMI | jq -r '.threshold') if [[ $THRESHOLD_CONNECTIONS =~ ^[0-9]+$ ]]; then