Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T6718: use the vyconf daemon for validation of set commands #11

Merged
merged 22 commits into from
Nov 7, 2024

Conversation

jestabro
Copy link
Contributor

@jestabro jestabro commented Oct 26, 2024

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-value executable 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 validateSetPath and setCfgPath, with a vyconfd operation taking the place of validateSetPath.

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Other (please describe):

Related Task(s)

Related PR(s)

vyos/vyos1x-config#31
vyos/vyatta-cfg#94
vyos/libvyosconfig#21
vyos/vyos-1x#4176
vyos/vyos-build#824

Proposed changes

How to test

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

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.
@dmbaturin dmbaturin merged commit 196fdd7 into vyos:master Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants