containerlab icon indicating copy to clipboard operation
containerlab copied to clipboard

links vars disappeared from config engine output

Open hellt opened this issue 2 years ago • 3 comments

topo

name: test
mgmt:
  external-access: true
  ipv4_subnet: 10.4.123.0/24
topology:
  kinds:
    vr-sros:
      image: registry.srlinux.dev/pub/vr-sros:22.10.R1
      license: /vsim_license/license.txt
  nodes:
    sr-1:
      kind: vr-sros
      type: ixr-s
      config:
        vars:
          clab_system_ip: 10.0.0.1/32
    sr-2:
      kind: vr-sros
      type: ixr-s
      config:
        vars:
          clab_system_ip: 10.0.0.2/32
  links:
    - endpoints: ["sr-1:eth1", "sr-2:eth1"]
      vars:
        port: ["1/1/1", "1/1/1"]
        clab_link_ip: 10.1.2.0/31
        vlan: 0

0.37 had vars

sudo clab config template --vars -t test.yml
INFO[0000] Parsing & checking topology file: test.yml
INFO[0000] sr-1 vars = clab_kind: vr-sros
clab_links:
- clab_far:
    clab_link_ip: 10.1.2.1/31
    clab_link_name: to_sr-1
    clab_node: sr-2
    port: 1/1/1
    vlan: 0
  clab_link_ip: 10.1.2.0/31
  clab_link_name: to_sr-2
  port: 1/1/1
  vlan: 0
clab_management_ipv4: ""
clab_management_ipv6: ""
clab_node: sr-1
clab_nodes: '{sr-2: {...}, sr-1: {...}, }'
clab_role: vr-sros
clab_system_ip: 10.0.0.1/32
clab_type: ixr-s
INFO[0000] sr-2 vars = clab_kind: vr-sros
clab_links:
- clab_far:
    clab_link_ip: 10.1.2.0/31
    clab_link_name: to_sr-2
    clab_node: sr-1
    port: 1/1/1
    vlan: 0
  clab_link_ip: 10.1.2.1/31
  clab_link_name: to_sr-1
  port: 1/1/1
  vlan: 0
clab_management_ipv4: ""
clab_management_ipv6: ""
clab_node: sr-2
clab_nodes: '{sr-2: {...}, sr-1: {...}, }'
clab_role: vr-sros
clab_system_ip: 10.0.0.2/32
clab_type: ixr-s

0.44+ doesn't

sudo clab config template --vars -t test.yml
WARN[0000] Attribute "ipv4_subnet" is deprecated and will be removed in the future. Change it to "ipv4-subnet"
INFO[0000] Parsing & checking topology file: test.yml
INFO[0000] sr-2 vars = clab_kind: vr-sros
clab_links: []
clab_management_ipv4: ""
clab_management_ipv6: ""
clab_node: sr-2
clab_nodes: '{sr-2: {...}, sr-1: {...}, }'
clab_role: vr-sros
clab_system_ip: 10.0.0.2/32
clab_type: ixr-s
INFO[0000] sr-1 vars = clab_kind: vr-sros
clab_links: []
clab_management_ipv4: ""
clab_management_ipv6: ""
clab_node: sr-1
clab_nodes: '{sr-2: {...}, sr-1: {...}, }'
clab_role: vr-sros
clab_system_ip: 10.0.0.1/32
clab_type: ixr-s

hellt avatar Sep 26 '23 13:09 hellt

As an almost sole user of this feature... will be forced to rollback :(. Let me know if I can help with something. Issue appeared on 0.43 it seems commit: #1475 is the culprit

sacckth avatar Oct 02 '23 23:10 sacckth

I've started working on this a little. https://github.com/steiler/containerlab/tree/templateVariablesFix Variables defined should already be alright, but all the IP-Assignment logic is not there yet.

steiler avatar Oct 16 '23 07:10 steiler

seems not many people using templates in clab? We are currently on 0.54.2 and I started looking into templating feature while facing this issue.

flosch-dev avatar May 28 '24 22:05 flosch-dev