-
Notifications
You must be signed in to change notification settings - Fork 335
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
T5083: extend xml schema definitions to support child requirements #3575
base: current
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,3 +149,6 @@ python/vyos/xml_ref/pkg_cache/*_cache.py | |
# We do not use pip | ||
Pipfile | ||
Pipfile.lock | ||
|
||
# KDE | ||
.directory |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,23 @@ | |
<regex>[-a-zA-Z0-9]+</regex> | ||
</constraint> | ||
<constraintErrorMessage>Container name must be alphanumeric and can contain hyphens</constraintErrorMessage> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>image</child> | ||
</requiredChildren> | ||
<mutuallyExclusiveChildren> | ||
<child>allow-host-networks</child> | ||
<child>network</child> | ||
</mutuallyExclusiveChildren> | ||
<atLeastOneOf> | ||
<child>allow-host-networks</child> | ||
<child>network</child> | ||
</atLeastOneOf> | ||
<oneWayDependantChildren> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The word "dependent" is misspelled here (see https://en.wiktionary.org/wiki/dependent) I also wonder if it should be just "dependentChildren" rather than "oneWayDependentChildren". |
||
<dependants><child>gid</child></dependants> | ||
<dependees><child>uid</child></dependees> | ||
</oneWayDependantChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
<leafNode name="allow-host-pid"> | ||
|
@@ -89,6 +106,11 @@ | |
<constraint> | ||
<validator name="sysctl"/> | ||
</constraint> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>value</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
<leafNode name="value"> | ||
|
@@ -104,6 +126,12 @@ | |
<tagNode name="device"> | ||
<properties> | ||
<help>Add a host device to the container</help> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>source</child> | ||
<child>destination</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
<leafNode name="source"> | ||
|
@@ -134,6 +162,11 @@ | |
<regex>[-_a-zA-Z0-9]+</regex> | ||
</constraint> | ||
<constraintErrorMessage>Environment variable name must be alphanumeric and can contain hyphen and underscores</constraintErrorMessage> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>value</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
<leafNode name="value"> | ||
|
@@ -205,6 +238,11 @@ | |
<regex>[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?</regex> | ||
</constraint> | ||
<constraintErrorMessage>Label variable name must be alphanumeric and can contain hyphen, dots and underscores</constraintErrorMessage> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>value</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
<leafNode name="value"> | ||
|
@@ -306,6 +344,12 @@ | |
<tagNode name="port"> | ||
<properties> | ||
<help>Publish port to the container</help> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>source</child> | ||
<child>destination</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
#include <include/listen-address.xml.i> | ||
|
@@ -414,6 +458,12 @@ | |
<tagNode name="volume"> | ||
<properties> | ||
<help>Mount a volume into the container</help> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>source</child> | ||
<child>destination</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
<leafNode name="source"> | ||
|
@@ -498,6 +548,11 @@ | |
<properties> | ||
<help>Network name</help> | ||
#include <include/constraint/container-network.xml.i> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>prefix</child> | ||
</requiredChildren> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
#include <include/generic-description.xml.i> | ||
|
@@ -525,6 +580,15 @@ | |
<tagNode name="registry"> | ||
<properties> | ||
<help>Registry Name</help> | ||
<childSpecification> | ||
<oneWayDependantChildren> | ||
<dependants><child>authentication</child></dependants> | ||
<dependees> | ||
<child>username</child> | ||
<child>password</child> | ||
</dependees> | ||
</oneWayDependantChildren> | ||
</childSpecification> | ||
</properties> | ||
<defaultValue>docker.io quay.io</defaultValue> | ||
<children> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,133 @@ | |
<format>vtunN</format> | ||
<description>OpenVPN interface name</description> | ||
</valueHelp> | ||
<childSpecification> | ||
<requiredChildren> | ||
<child>mode</child> | ||
</requiredChildren> | ||
<!-- OpenVPN client mode --> | ||
<oneWayDependantChildren> | ||
<dependants><descendant name="mode"><value>client</value></descendant></dependants> | ||
<dependees> | ||
<child>remote_host</child> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Underscore, not a hyphen? |
||
</dependees> | ||
</oneWayDependantChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="mode"><value>client</value></descendant> | ||
<child>local-port</child> | ||
<child>local-host</child> | ||
<descendant name="tls"><child>dh-params</child></descendant> | ||
</mutuallyExclusiveChildren> | ||
<!-- / OpenVPN client mode --> | ||
<!-- OpenVPN site-to-site --> | ||
<oneWayDependantChildren> | ||
<dependants><descendant name="mode"><value>site-to-site</value></descendant></dependants> | ||
<dependees> | ||
<child>remote-host</child> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Site-to-site mode doesn't actually require |
||
</dependees> | ||
</oneWayDependantChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="mode"><value>site-to-site</value></descendant> | ||
<descendant name="encryption"><child>ncp-ciphers</child></descendant> | ||
</mutuallyExclusiveChildren> | ||
<!-- / OpenVPN site-to-site --> | ||
<!-- OpenVPN server mode --> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="mode"><value>server</value></descendant> | ||
<descendant name="protocol"><value>tcp-active</value></descendant> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="mode"><value>server</value></descendant> | ||
<child>authentication</child> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sequence of I'm also thinking that In a situation when a node value is incompatible with a bunch of children, we may want to call it something else. At the very least I'd like a more compact syntax, like:
|
||
<descendant name="mode"><value>server</value></descendant> | ||
<child>remote-host</child> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="mode"><value>server</value></descendant> | ||
<child>remote-port</child> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<child>server</child> | ||
<descendant name="mode"> | ||
<value>site-to-site</value> | ||
<value>client</value> | ||
</descendant> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyDependantChildren> | ||
<descendant name="authentication"> | ||
<child>username</child> | ||
<child>password</child> | ||
</descendant> | ||
</mutuallyDependantChildren> | ||
<mutuallyDependantChildren> | ||
<descendant name="server"><descendant name="client-ip-pool"> | ||
<child>start</child> | ||
<child>stop</child> | ||
</descendant></descendant> | ||
</mutuallyDependantChildren> | ||
<!-- / OpenVPN server mode --> | ||
<!-- checks for both client and site-to-site go here --> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="mode"> | ||
<value>client</value> | ||
<value>site-to-site</value> | ||
</descendant> | ||
<descendant name="server"><child>reject-unconfigured-clients</child></descendant> | ||
</mutuallyExclusiveChildren> | ||
<!-- / checks for both client and site-to-site go here --> | ||
<!-- OpenVPN common verification section (not depending on any operation mode) --> | ||
<!-- TCP active --> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="protocol"><value>tcp-active</value></descendant> | ||
<child>local-port</child> | ||
</mutuallyExclusiveChildren> | ||
<oneWayDependantChildren> | ||
<dependants><descendant name="protocol"><value>tcp-active</value></descendant></dependants> | ||
<dependees><child>remote-host</child></dependees> | ||
</oneWayDependantChildren> | ||
<!-- / TCP active --> | ||
<!-- TLS/encryption --> | ||
<mutuallyExclusiveChildren> | ||
<child>shared_secret_key</child> | ||
<descendant name="encryption"><descendant name="cipher"> | ||
<value>aes128gcm</value> | ||
<value>aes192gcm</value> | ||
<value>aes256gcm</value> | ||
</descendant></descendant> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="tls"><child>auth-key</child></descendant> | ||
<descendant name="tls"><child>crypt-key</child></descendant> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="tls"> | ||
<descendant name="role"> | ||
<value>active</value> | ||
</descendant> | ||
</descendant> | ||
<descendant name="protocol"><value>tcp-passive </value></descendant> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="tls"> | ||
<descendant name="role"> | ||
<value>active</value> | ||
</descendant> | ||
</descendant> | ||
<child>dh-params</child> | ||
</mutuallyExclusiveChildren> | ||
<mutuallyExclusiveChildren> | ||
<descendant name="tls"> | ||
<descendant name="role"> | ||
<value>passive</value> | ||
</descendant> | ||
</descendant> | ||
<descendant name="protocol"><value>tcp-active</value></descendant> | ||
</mutuallyExclusiveChildren> | ||
<!-- / TLS/encryption --> | ||
<!-- / OpenVPN common verification section (not depending on any operation mode) --> | ||
</childSpecification> | ||
</properties> | ||
<children> | ||
#include <include/interface/authentication.xml.i> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change might be sensible for KDE users (not for me — I use MATE, btw; but @jestabro does use KDE :).
But it's out of scope of this PR, could you make it separate please?