Skip to content

Commit b53a890

Browse files
lipxumssonicbld
authored andcommitted
disable restapi for leafRouter in slim image (sonic-net#17713)
Why I did it For some devices with small memory, after upgrading to the latest image, the available memory is not enough. Work item tracking Microsoft ADO (number only): 26324242 How I did it Disable restapi feature for LeafRouter which with slim image. How to verify it verified on 7050qx T1 (slim image), restapi disabled verified on 7050qx T0 (slim image), restapi enabled verified on 7260 T1 (normal image), restapi enabled
1 parent 8561fa6 commit b53a890

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

files/build_templates/init_cfg.json.j2

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@
5050
{%- if include_mux == "y" %}{% do features.append(("mux", "{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}enabled{% else %}always_disabled{% endif %}", false, "enabled")) %}{% endif %}
5151
{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %}
5252
{%- if include_p4rt == "y" %}{% do features.append(("p4rt", "disabled", false, "enabled")) %}{% endif %}
53-
{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %}
53+
{%- if include_restapi == "y" and BUILD_REDUCE_IMAGE_SIZE == "y" and sonic_asic_platform == "broadcom" %}
54+
{% do features.append(("restapi", "{% if (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] is not in ['LeafRouter', 'BackEndLeafRouter']) %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}
55+
{%- elif include_restapi == "y" %}
56+
{% do features.append(("restapi", "enabled", false, "enabled")) %}
57+
{%- endif %}
5458
{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", true, "enabled")) %}{% endif %}
5559
{%- if include_macsec == "y" %}{% do features.append(("macsec", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' and DEVICE_RUNTIME_METADATA['MACSEC_SUPPORTED'] %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}{% endif %}
5660
{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", true, "enabled")) %}{% endif %}

0 commit comments

Comments
 (0)