Skip to content
Merged
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
10 changes: 10 additions & 0 deletions dockers/docker-orchagent/ipinip.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
{%- set ipv6_vlan_addresses = ipv6_vlan_addresses.append(prefix) %}
{%- endif %}
{% endfor %}
{# Generation of IP-in-IP decap entries is disabled for BackEnd device types. #}
{%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%}
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types %}
{% set ipv4_addresses = [] %}
{% set ipv6_addresses = [] %}
{% set ipv4_vlan_addresses = [] %}
{% set ipv6_vlan_addresses = [] %}
{% set ipv4_loopback_addresses = [] %}
{% set ipv6_loopback_addresses = [] %}
Comment on lines +58 to +63
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These re-initializations effectively discard all prefixes collected from LOOPBACK_INTERFACE/INTERFACE/PORTCHANNEL_INTERFACE/VLAN_INTERFACE above, leaving the rest of the template as dead code. To make the intent clearer and avoid unnecessary processing, consider short-circuiting the template to render an empty JSON list (or gating the whole generation behind an explicit config/flag) rather than building then clearing these lists.

Suggested change
{% set ipv4_addresses = [] %}
{% set ipv6_addresses = [] %}
{% set ipv4_vlan_addresses = [] %}
{% set ipv6_vlan_addresses = [] %}
{% set ipv4_loopback_addresses = [] %}
{% set ipv6_loopback_addresses = [] %}

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +63
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes the template render an empty list, which will break the existing sonic-config-engine golden tests that assert ipinip.json output contents (e.g., test_ipinip, test_ipinip_subnet_decap_enable, and the multi-asic ipinip.json golden file). Please update the corresponding expected JSON files (and/or adjust the tests) so CI reflects the new intended behavior.

Suggested change
{% set ipv4_addresses = [] %}
{% set ipv6_addresses = [] %}
{% set ipv4_vlan_addresses = [] %}
{% set ipv6_vlan_addresses = [] %}
{% set ipv4_loopback_addresses = [] %}
{% set ipv6_loopback_addresses = [] %}

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +63
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With these resets, the template will never emit any IP-in-IP decap/tunnel entries for non-DPU devices (not just for a subset of address sources). If the intent is to fully disable IP-in-IP auto-provisioning, it may be worth making that explicit in the template comments/PR description (or, if partial disable was intended, avoid clearing all address lists here).

Copilot uses AI. Check for mistakes.
{% endif %}
{%- set ipv4_addresses = ipv4_addresses + ipv4_vlan_addresses %}
{%- set ipv6_addresses = ipv6_addresses + ipv6_vlan_addresses %}
{# SAI report tunnel TABLE_FULL for large topo. Only generating for VLAN and loopback if over 128 routed interfaces.#}
Expand Down