T6718: use the vyconf daemon for validation of set commands#11
Merged
dmbaturin merged 22 commits intovyos:masterfrom Nov 7, 2024
Merged
T6718: use the vyconf daemon for validation of set commands#11dmbaturin merged 22 commits intovyos:masterfrom
dmbaturin merged 22 commits intovyos:masterfrom
Conversation
This was referenced Oct 26, 2024
Update as needed for use with contemporary vyos1x-config: . update build system to use dune . drop use of batteries . update for protoc breaking changes in versions >= 3.0 . remove files now in vyos1x-config (config_tree et. al.; parsing)
Regenerate protobuf files: ocaml-protoc --ml_out src/ data/vyconf.proto The generated files vyconf.* are renamed vyconf_pbt.* instead of the split into vyconf_pb/vyconf_types as in the original implementation.
Update tests, as appropriate: for example, the Vyconf config file grammar is distinct from the one currently used in vyos1x-config, consequently the curly_parser_test is not included.
The root node name was changed in vyos1x-config (T4491) so as not to conflict with actual nodes named "root".
For convenience and to avoid dune build conflict, all util functions now reside in vyos1x-config.util.
An empty protobuf message does not correctly generate encode/decode functions. This appears to be fixed upstream, but for now, use workaround of adding a reasonable field.
The vyos1x-adapter provides access to the legacy CStore set/delete functions using ctypes. Developed as a separate package, include as a subdir, to be retired when full replacements are available.
The standard package Arg is understandably confused by paths such as: interfaces openvpn vtun0 openvpn-option --persist-tun Collect args from Sys.argv and use env vars for debug options.
29bbab6 to
9b90d3c
Compare
dmbaturin
approved these changes
Nov 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
The VyConf package is updated to run all validation functionality for VyOS set commands. This requires the supporting PR's listed below for vyos1x-config; vyatta-cfg; libvyosconfig; vyos-1x; vyos-build.
As the
validate-valueexecutable was an external implementation of the existing VyConf code (validate_value/validate_path), designed to work with the legacy set function, this can be viewed as a reintegration with the VyConf design.This requires (1) various minor compatibility changes (2) addition of a vyos1x-adapter module to separate the legacy Cstore functions
validateSetPathandsetCfgPath, with a vyconfd operation taking the place ofvalidateSetPath.This has the secondary benefit of bringing up vyconfd within the current VyOS ecosystem: incremental additions to vyconfd functionality will provide a path to nondisruptive retirement of the Cstore data structures and methods.
Note that the reference_tree structure and supporting functions were previously relocated to vyos1x-config in order to allow interim access to the XML definitions, so all required changes to those structures/functions are in the companion PR.
Types of changes
Related Task(s)
Related PR(s)
vyos/vyos1x-config#31
vyos/vyatta-cfg#94
vyos-legacy/libvyosconfig#21
vyos/vyos-1x#4176
vyos/vyos-build#824
Proposed changes
How to test
Checklist: