Repository navigation
Closed
Description
In an AFK discussion, the following question was brought up:
Sooner or later, we will have to make breaking changes to YANG models that will cause
confdto reject old configs. How should we handle that?
Some ideas:
confdshould only care about the current YANG models belonging to any given version of Infix.- We can create special text transformers that translate a valid
infix-x.y.zconfig to a validinfix-x+1.y.zconfig, these can be simple scripts that run a fewjq(1)pipelines. - The transformers can be stacked as infix evolves to support going from any config version to the present.
- The original config should always be preserved, so that a user can audit the diff.
- The config files need a version field, so that we know the starting point in the transformer stack.
Config File Versioning
To keep the version information somewhat out-of-band from the actual configuration data, we should look at the possibility of adding it as a metadata annotation.
Sketch:
module infix-system {
import ietf-yang-metadata {
prefix "md";
}
md:annotation compatible {
type string;
description
"Specifies the operating system which this configuration
is compatible with. When a generated by the system
itself, it is set to the concatenation of ID and
VERSION_ID, as specified in /etc/os-release, joined by
a hyphen.";
}
}
Example:
{
"ietf-system:system": {
"@": {
"infix-system:compatible": "infix-v24.06.0"
}
}
}Having the OS name in addition to the version could potentially enable one OS to extract general settings from another, while ignoring OS-specific configuration.
Backup/Restore
- Add
restore-configRPC that will parse out the metadata and run the required transforms before feeding it tosysrepo. - If we ever start to version config's on the device, provide a
backup-configRPC that can fetch older versions.
Reacted by Joachim Wiberg
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Type
Projects
- StatusShow more project fieldsDone
Activity
troglobit commentedon Feb 29, 2024
PR #324 shows an alternative/complementary route to take for breaking changes:
deprecatedorobsolete(needs planning ahead)troglobit commentedon Jun 16, 2024
@wkz unfortunately it appears that sysrepo does not support annotations: sysrepo/sysrepo#2462 The bug report has a few years to it, but this seems to be still the case. so I'll go ahead and add a plain config augment with a discouraging description instead.
conf: add support for handling breaking model changes
troglobit commentedon Jun 17, 2024
Break out into own model, infix-version.yang
conf: add support for handling breaking model changes
conf: add support for handling breaking model changes
conf: add support for handling breaking model changes
conf: add support for handling breaking model changes
conf: add support for handling breaking model changes