fix(schema): accept an integer netmask in network config v1 - #6998
Open
sbraz wants to merge 1 commit into
Open
Conversation
A config drive setting an IPv6 route netmask as an integer produces this, even though the route is applied correctly: ``` schema.py[WARNING]: network-config-v1 failed schema validation! You may run 'sudo cloud-init schema --system' to check the details. ``` ``` # cloud-init schema --system Error: Cloud config schema errors: config.0.subnets.1.routes.0.netmask: 128 is not of type 'string' ``` Nothing that reads the value requires a string: - `_normalize_net_keys()` passes `netmask`, for subnets and routes, to `ipv4_mask_to_net_prefix()` or `ipv6_mask_to_net_prefix()`, which document accepting an integer or a string representation of one. - `test_ipv6_static_routes_ip_cmd` renders a v1 config containing both `"netmask": 24` as an integer and `"netmask": "32"` as a string. Accept an integer alongside a string, for subnets and routes, and reword the description to cover IPv6.
sbraz
force-pushed
the
network_v1_schema_netmask_integer
branch
from
August 12, 2026 20:40
69f12b4 to
cdb4644
Compare
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.
Proposed Commit Message
Test Steps
Before:
After:
Unit tests:
Merge type