Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dockers/docker-sonic-gnmi/gnmi-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TELEMETRY_VARS=${TELEMETRY_VARS//[\']/\"}
X509=$(echo $TELEMETRY_VARS | jq -r '.x509')
GNMI=$(echo $TELEMETRY_VARS | jq -r '.gnmi')
CERTS=$(echo $TELEMETRY_VARS | jq -r '.certs')
IS_SMART_SWITCH_DPU=$(echo $TELEMETRY_VARS | jq -r '.is_smart_switch_dpu')

# Enable GRPC GO LOG
export GRPC_GO_LOG_VERBOSITY_LEVEL=99
Expand Down Expand Up @@ -57,7 +58,11 @@ elif [ -n "$X509" ]; then
TELEMETRY_ARGS+=" --ca_crt $CA_CRT"
fi
else
TELEMETRY_ARGS+=" --noTLS --bind_address 127.0.0.1"
if [[ x"${IS_SMART_SWITCH_DPU}" == x"true" ]]; then
TELEMETRY_ARGS+=" --noTLS --no_tls_link_local_interface eth0-midplane"
else
TELEMETRY_ARGS+=" --noTLS --bind_address 127.0.0.1"
fi
fi

# If no configuration entry exists for TELEMETRY, create one default port
Expand Down
7 changes: 4 additions & 3 deletions dockers/docker-sonic-gnmi/telemetry_vars.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"certs": {% if "certs" in GNMI.keys() %}{{ GNMI["certs"] }}{% else %}""{% endif %},
"gnmi" : {% if "gnmi" in GNMI.keys() %}{{ GNMI["gnmi"] }}{% else %}""{% endif %},
"x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %}
"certs": {% if GNMI is defined and "certs" in GNMI %}{{ GNMI["certs"] }}{% else %}""{% endif %},
"gnmi" : {% if GNMI is defined and "gnmi" in GNMI %}{{ GNMI["gnmi"] }}{% else %}""{% endif %},
"x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %},
"is_smart_switch_dpu": {{ (DEVICE_METADATA["localhost"].get("type") == "SmartSwitchDPU" or DEVICE_METADATA["localhost"].get("switch_type") == "dpu") | lower }}
}
7 changes: 6 additions & 1 deletion dockers/docker-sonic-telemetry/telemetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ TELEMETRY_VARS=${TELEMETRY_VARS//[\']/\"}
X509=$(echo $TELEMETRY_VARS | jq -r '.x509')
GNMI=$(echo $TELEMETRY_VARS | jq -r '.gnmi')
CERTS=$(echo $TELEMETRY_VARS | jq -r '.certs')
IS_SMART_SWITCH_DPU=$(echo $TELEMETRY_VARS | jq -r '.is_smart_switch_dpu')

export GRPC_GO_LOG_VERBOSITY_LEVEL=99
export GRPC_GO_LOG_SEVERITY_LEVEL=info
Expand Down Expand Up @@ -77,7 +78,11 @@ elif [ -n "$X509" ]; then
TELEMETRY_ARGS+=" --ca_crt $CA_CRT"
fi
else
TELEMETRY_ARGS+=" --noTLS --bind_address 127.0.0.1"
if [[ x"${IS_SMART_SWITCH_DPU}" == x"true" ]]; then
TELEMETRY_ARGS+=" --noTLS --no_tls_link_local_interface eth0-midplane"
else
TELEMETRY_ARGS+=" --noTLS --bind_address 127.0.0.1"
fi
fi

# If no configuration entry exists for TELEMETRY, create one default port
Expand Down
7 changes: 4 additions & 3 deletions dockers/docker-sonic-telemetry/telemetry_vars.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"certs": {% if "certs" in TELEMETRY.keys() %}{{ TELEMETRY["certs"] }}{% else %}""{% endif %},
"gnmi" : {% if "gnmi" in TELEMETRY.keys() %}{{ TELEMETRY["gnmi"] }}{% else %}""{% endif %},
"x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %}
"certs": {% if TELEMETRY is defined and "certs" in TELEMETRY %}{{ TELEMETRY["certs"] }}{% else %}""{% endif %},
"gnmi" : {% if TELEMETRY is defined and "gnmi" in TELEMETRY %}{{ TELEMETRY["gnmi"] }}{% else %}""{% endif %},
"x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %},
"is_smart_switch_dpu": {{ (DEVICE_METADATA["localhost"].get("type") == "SmartSwitchDPU" or DEVICE_METADATA["localhost"].get("switch_type") == "dpu") | lower }}
}
2 changes: 1 addition & 1 deletion src/sonic-gnmi
Loading