Skip to content

Commit

Permalink
Add VRF parameter to orchagent and GNMI start script. (sonic-net#20345)
Browse files Browse the repository at this point in the history
Add VRF parameter to orchagent and GNMI start script.

Why I did it
Orchagent failed bind to ZMQ when mgmt VRF enabled: sonic-net#19638

How I did it
Add VRF parameter to orchagent and GNMI start script when mgmt-vrf feature enabled.

How to verify it
Pass all UT.
  • Loading branch information
liuh-80 authored and KAVITHA RAMALINGAM committed Nov 15, 2024
1 parent 15ca309 commit a661032
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dockers/docker-orchagent/orchagent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
6 changes: 6 additions & 0 deletions dockers/docker-sonic-gnmi/gnmi-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a661032

Please sign in to comment.