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

T6404: add constraintGroup element to reference tree #27

Merged
merged 1 commit into from
May 27, 2024

Conversation

jestabro
Copy link
Contributor

Change Summary

The constraintGroup element was missed when defining the reference tree, as it has not yet had a use case. However, in the context of https://vyos.dev/T3493, it was suggested to use the following construction quoted below (only in Sagitta); note that a partial solution is already present, and may be considered sufficient.

For future use of a constraintGroup, this PR should be merged for 1.5, and the Dockerfile updated.

NOTE: it is up to @c-po whether this should be backported to allow extending T3493 with the patch below: if so, we need to make sure that the Dockerfile has been updated with commit ref for vyos1x-config AND that libvyosconfig and vyos-1x are rebuilt with that container before 1.4.0-GA.

Tested with the patch below, all smoketests pass, notably, test_service_dhcpv6-server.py.

diff --git a/interface-definitions/service_dhcpv6-server.xml.in b/interface-definitions/service_dhcpv6-server.xml.in
index effba3884..589eb709c 100644
--- a/interface-definitions/service_dhcpv6-server.xml.in
+++ b/interface-definitions/service_dhcpv6-server.xml.in
@@ -228,10 +228,11 @@
                             <format>ipv6</format>
                             <description>IPv6 address used in prefix delegation</description>
                           </valueHelp>
-                          <constraint>
+                          <constraintGroup>
+                            <validator name="ipv6-address"/>
                             <!-- IPv6 address used MUST end with :: -->
                             <regex>([a-fA-F0-9]{1,4}:)+:</regex>
-                          </constraint>
+                          </constraintGroup>
                         </properties>
                         <children>
                           <leafNode name="prefix-length">
@@ -254,10 +255,11 @@
                                 <format>ipv6</format>
                                 <description>IPv6 address used in prefix delegation</description>
                               </valueHelp>
-                              <constraint>
+                              <constraintGroup>
+                                <validator name="ipv6-address"/>
                                 <!-- IPv6 address used MUST end with :: -->
                                 <regex>([a-fA-F0-9]{1,4}:)+:</regex>
-                              </constraint>
+                              </constraintGroup>
                             </properties>
                           </leafNode>
                         </children>

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)

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

@jestabro jestabro self-assigned this May 27, 2024
@c-po c-po merged commit fc327ec into vyos:current May 27, 2024
1 check passed
@c-po
Copy link
Member

c-po commented May 27, 2024

@Mergifyio backport sagitta

Copy link

mergify bot commented May 27, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request May 27, 2024
T6404: add constraintGroup element to reference tree (backport #27)
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.

3 participants