[aks-preview] Add --node-public-ip-prefix-ids for dual-stack ILPIP support#9828
[aks-preview] Add --node-public-ip-prefix-ids for dual-stack ILPIP support#9828christine33-creator wants to merge 6 commits intoAzure:mainfrom
Conversation
❌Azure CLI Extensions Breaking Change Test
|
|
Hi @christine33-creator, |
|
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>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
There was a problem hiding this comment.
Pull request overview
This PR adds dual-stack instance-level public IP prefix support to the aks-preview extension by introducing a new --node-public-ip-prefix-ids option (comma-separated list) for az aks create and az aks nodepool add, and wiring it through the agent pool construction path and vendored SDK model.
Changes:
- Add
--node-public-ip-prefix-idsargument (and mutual exclusion with--node-public-ip-prefix-id) foraks createandaks nodepool add. - Parse the comma-separated value in the agentpool context and set
agentpool.network_profile.node_public_ip_prefix_ids, auto-enabling node public IP when set. - Vendor the new
AgentPoolNetworkProfile.node_public_ip_prefix_idsfield, bump extension version, update changelog, and add unit tests for parsing.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/aks-preview/setup.py |
Bumps extension version to 20.0.0b5. |
src/aks-preview/HISTORY.rst |
Adds release notes for the new CLI parameter. |
src/aks-preview/azext_aks_preview/_params.py |
Registers node_public_ip_prefix_ids for aks create and aks nodepool add with a validator and help text. |
src/aks-preview/azext_aks_preview/_validators.py |
Adds a mutual-exclusion validator for plural vs singular prefix args. |
src/aks-preview/azext_aks_preview/custom.py |
Extends aks_create and aks_agentpool_add signatures to accept the new parameter. |
src/aks-preview/azext_aks_preview/agentpool_decorator.py |
Adds parsing context method and decorates the AgentPool network profile with node_public_ip_prefix_ids. |
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/models/_models.py |
Adds node_public_ip_prefix_ids to the vendored AgentPoolNetworkProfile model. |
src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py |
Adds unit tests for the new context parsing method. |
src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py |
Updates expected params for agentpool setup to include the new key. |
linter_exclusions.yml |
Adds option-length exclusions for the new parameter for relevant commands. |
| :ivar application_security_groups: The IDs of the application security groups which agent pool | ||
| will associate when created. | ||
| :vartype application_security_groups: list[str] | ||
| :ivar node_public_ip_prefix_ids: The public IP prefix IDs which VM nodes should use IPs from. |
There was a problem hiding this comment.
Please do not manually touch the SDK. Is the field published in the API spec?
There was a problem hiding this comment.
Please consider adding a new scenario test case to verify the change.
There was a problem hiding this comment.
Added test_node_public_ip_prefix_ids in test_aks_commands.py`
There was a problem hiding this comment.
Yes, the field is published in the API spec: Azure/azure-rest-api-specs#42519
Fully reverted all manual edits to _models.py. Changed agentpool_decorator.py to use dictionary-style access (network_profile["nodePublicIPPrefixIDs"] = ...] so the field is serialized into the request JSON without needing the SDK model to define it. Please let me know if this isn't the right approach.
There was a problem hiding this comment.
I see, the API spec change hasn't been officially published yet (it's merged to a dev branch), so the SDK hasn't been updated to include it. You can continue using your current workaround for testing, but please wait until the SDK is updated and use the model from the SDK directly before merging the change.
…pport Add a new CLI parameter --node-public-ip-prefix-ids (comma-separated list of public IP prefix resource IDs) to 'az aks create' and 'az aks nodepool add' for dual-stack instance-level public IPs (IPv4 and/or IPv6). - Register parameter in _params.py for aks create and nodepool add - Add mutual exclusion validator with --node-public-ip-prefix-id (singular) - Wire parameter through custom.py function signatures - Add get_node_public_ip_prefix_ids() context method in agentpool_decorator - Set network_profile.node_public_ip_prefix_ids on the SDK model - Auto-enable enable_node_public_ip when prefix IDs are provided - Add node_public_ip_prefix_ids field to vendored AgentPoolNetworkProfile - Add unit tests for the new context method - Not added to nodepool update (field is immutable on existing pools)
…py entries - Fix help text: 'Requires --enable-node-public-ip' -> 'Automatically enables' - Add --node-public-ip-prefix-ids to _help.py for both aks create and nodepool add - Enhance validator: check non-empty, max 2 IDs, valid resource IDs - Handle empty string in decorator: raise InvalidArgumentValueError - Add unit test for empty string error case
- Revert manual edits to vendored SDK _models.py (AgentPoolNetworkProfile) - Use dictionary-style access (network_profile["nodePublicIPPrefixIDs"]) instead of attribute access, so the field is serialized correctly without requiring the SDK to be re-vendored - Add scenario test test_node_public_ip_prefix_ids covering both aks create and aks nodepool add with dual-stack IP prefixes
267c192 to
9f6a330
Compare
The scenario test requires the NodePublicIPv6PrefixPreview feature flag and Azure credentials. Mark it @live_only() so it is skipped during CI recording-based test runs.
Add a new CLI parameter --node-public-ip-prefix-ids (comma-separated list of public IP prefix resource IDs) to 'az aks create' and 'az aks nodepool add' for dual-stack instance-level public IPs (IPv4 and/or IPv6).
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks create
az aks nodepool add
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.