Page MenuHomeVyOS Platform

Switch to new syntax for config file component versions
Closed, ResolvedPublicFEATURE REQUEST

Description

The trailing comments in the config file contain the component version information, which is used by migration scripts. The syntax of the comments have several issues, as mentioned here:

http://wiki.vyos.net/wiki/Migration_scripts#Changing_the_trailing_comment_syntax

The migration script runner rewrite (T1334) put in place the mechanism for using a preferable syntax, which is natively supported by the vyos1x-config, respectively, vyatta-cfg, parsers (commit ea9bee4c9e0a12947027bb83a6bf493cdf1ed1ed in libvyosconfig, before the refactor to vyos1x-config; respectively, commit e4fe8143d9a9d86eafe04fed3cd788659b46f465 in vyatta-cfg).

Current syntax:

/* Warning: Do not remove the following line. */
/* === vyatta-config-version: "broadcast-relay@1:cluster@1:config-management@1:conntrack@1:conntrack-sync@1:dhcp-relay@2:dhcp-server@5:dns-forwarding@2:firewall@5:interfaces@4:ipsec@5:l2tp@2:lldp@1:mdns@1:nat@4:ntp@1:pptp@1:qos@1:quagga@4:snmp@1:ssh@1:system@16:vrrp@2:vyos-accel-ppp@2:wanloadbalance@3:webgui@1:webproxy@2:zone-policy@1" === */
/* Release version: 1.3-rolling-202002121701 */

New syntax:

// Warning: Do not remove the following line.
// vyos-config-version: "broadcast-relay@1:cluster@1:config-management@1:conntrack@1:conntrack-sync@1:dhcp-relay@2:dhcp-server@5:dns-forwarding@2:firewall@5:interfaces@4:ipsec@5:l2tp@2:lldp@1:mdns@1:nat@4:ntp@1:pptp@1:qos@1:quagga@4:snmp@1:ssh@1:system@16:vrrp@2:vyos-accel-ppp@2:wanloadbalance@3:webgui@1:webproxy@2:zone-policy@1"
// Release version: 1.3-rolling-202002121701

Two additions will precede the switch:
(1) the migration runner script will run the VirtualMigrator (which updates syntax) before Migrator; though the switch over can be set globally, this is to avoid the need for preprocessing the syntax in configtree.
(2) remove default syntax target from VirtualMigrator, to allow virtual migration to the old syntax for portability to earlier releases.

Details

Difficulty level
Normal (likely a few hours)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Config syntax change (migratable)
Issue type
Internal change (not visible to end users)

Event Timeline

jestabro updated the task description. (Show Details)
jestabro updated the task description. (Show Details)
jestabro triaged this task as Normal priority.Feb 12 2020, 7:45 PM
jestabro changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).

https://github.com/vyos/vyos-1x/pull/224

This PR changes the syntax of the trailing version string of the config file (cf. above), as represented during config migration, and the parsing by which configtree splits the config file into the config section proper and the version string.

The version string is written to the config file on two occasions:
(1) During migration, which happens on boot of livecd, load config, or merge config.
(2) On configuration save.

This PR enforces the separation of the two mechanisms, and addresses (1). As the syntax is updated before running any migration scripts (virtual- or meta- migration), there is no issue in ignoring (2) for the moment, and hence retaining the classic syntax on save; this will maintain portability and expected output for now.

N.B. one will see the following: on first boot of livecd or installed image, the config file will have the new syntax, as 'save' has not occurred. As soon as the config is saved, it will have the classic syntax. The choice of syntax written on save is determined by the string 'vintage' (one of ['vyatta', 'vyos']) in python/vyos/defaults.py.

jestabro changed the task status from Open to Needs testing.Feb 20 2020, 8:33 PM
erkin set Issue type to Internal change (not visible to end users).Aug 31 2021, 5:43 PM