[Network] az network vnet subnet create/update: Support IPAM pool allocation#31643
[Network] az network vnet subnet create/update: Support IPAM pool allocation#31643
az network vnet subnet create/update: Support IPAM pool allocation#31643Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| network vnet subnet create | cmd network vnet subnet create added parameter ipam_pool_prefix_allocations |
||
| network vnet subnet update | cmd network vnet subnet update added parameter ipam_pool_prefix_allocations |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for IPAM pool allocation in the subnet create/update workflow by adding a new property ("ipam_pool_prefix_allocations") and updating the API version from "2024-01-01" to "2024-07-01". It also adds test coverage for the new behavior and updates relevant AAZ schema definitions across multiple commands.
- Updated API versions and AAZ schemas to "2024-07-01"
- Added new "ipam_pool_prefix_allocations" field handling in command implementations and custom logic
- Modified test cases to cover subnet creation with IPAM pool allocations
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/latest/test_network_commands.py | Renamed test function and added a new subnet create command to validate IPAM pool allocation |
| custom.py | Added conditional checks for ipam_pool_prefix_allocations before clearing address_prefixes |
| aaz/latest/network/vnet/subnet/* | Updated API versions and extended schema definitions to include IPv6 and IPAM pool allocations for subnet, update, show, list, delete, and create commands |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/vnet/subnet/_create.py:70
- [nitpick] Consider adding explicit validation to enforce mutual exclusivity between '--address-prefixes' and '--ipam-allocations' to prevent configuration conflicts.
help="Space-separated list of address prefixes in CIDR format. If provided, --ipam-allocations should not be specified.",
| logger.warning(subnet_disable_pls_msg) | ||
| args.private_link_service_network_policies = args.disable_private_link_service_network_policies | ||
|
|
||
| if args.ipam_pool_prefix_allocations.to_serialized_data(): |
There was a problem hiding this comment.
[nitpick] Consider using the common 'has_value' function to check for ipam_pool_prefix_allocations instead of directly calling 'to_serialized_data()', to maintain consistency with the existing code.
| if args.ipam_pool_prefix_allocations.to_serialized_data(): | |
| if has_value(args.ipam_pool_prefix_allocations): |
fb57416 to
f3cd25e
Compare
f3cd25e to
277e858
Compare
evelyn-ys
left a comment
There was a problem hiding this comment.
Why all the test recordings are manually replacing with the new API version? All these tests can't pass live run? Even network module is using manual replacement which makes me uncertain about the quality...🤔
277e858 to
ced715a
Compare
ced715a to
4d2c148
Compare
7ede45b to
a5ee38d
Compare
Related command
az network vnet subnet create/updateDescription
resolve #31447
aaz Azure/aaz#781
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.