-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[PostgreSQL] Refactor PostgreSQL network commands and validation logic #33111
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
base: dev
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -201,30 +201,18 @@ def _flexible_server_params(command_group): | |||||||||||||||||
| options_list=['--vnet'], | ||||||||||||||||||
| help='Name or ID of a new or existing virtual network. ' | ||||||||||||||||||
| 'If you want to use a vnet from different resource group or subscription, ' | ||||||||||||||||||
| 'please provide a resource ID. The name must be between 2 to 64 characters. ' | ||||||||||||||||||
| 'provide a resource ID. The name must be between 2 to 64 characters. ' | ||||||||||||||||||
| 'The name must begin with a letter or number, end with a letter, number or underscore, ' | ||||||||||||||||||
| 'and may contain only letters, numbers, underscores, periods, or hyphens.' | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| vnet_address_prefix_arg_type = CLIArgumentType( | ||||||||||||||||||
| options_list=['--address-prefixes'], | ||||||||||||||||||
| help='The IP address prefix to use when creating a new virtual network in CIDR format. ' | ||||||||||||||||||
| 'Default value is 10.0.0.0/16.' | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| subnet_arg_type = CLIArgumentType( | ||||||||||||||||||
| options_list=['--subnet'], | ||||||||||||||||||
| help='Name or resource ID of a new or existing subnet. ' | ||||||||||||||||||
| 'If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. ' | ||||||||||||||||||
| 'Please note that the subnet will be delegated to flexibleServers. ' | ||||||||||||||||||
| 'If you want to use a subnet from different resource group or subscription, provide a resource ID instead of name. ' | ||||||||||||||||||
| 'Note that the subnet will be delegated to flexibleServers. ' | ||||||||||||||||||
| 'After delegation, this subnet cannot be used for any other type of Azure resources.' | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| subnet_address_prefix_arg_type = CLIArgumentType( | ||||||||||||||||||
| options_list=['--subnet-prefixes'], | ||||||||||||||||||
| help='The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.' | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| zone_arg_type = CLIArgumentType( | ||||||||||||||||||
| options_list=['--zone', '-z'], | ||||||||||||||||||
| help='Availability zone into which to provision the resource.' | ||||||||||||||||||
|
|
@@ -280,16 +268,16 @@ def _flexible_server_params(command_group): | |||||||||||||||||
| private_dns_zone_arguments_arg_type = CLIArgumentType( | ||||||||||||||||||
| options_list=['--private-dns-zone'], | ||||||||||||||||||
| help='This parameter only applies for a server with private access. ' | ||||||||||||||||||
| 'The name or id of new or existing private dns zone. ' | ||||||||||||||||||
| 'You can use the private dns zone from same resource group, different resource group, or different subscription. ' | ||||||||||||||||||
| 'If you want to use a zone from different resource group or subscription, please provide resource Id. ' | ||||||||||||||||||
| 'CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.' | ||||||||||||||||||
| 'The name or id of new or existing private DNS zone. ' | ||||||||||||||||||
| 'You can use the private DNS zone from same resource group, different resource group, or different subscription. ' | ||||||||||||||||||
| 'If you want to use a DNS zone from different resource group or subscription, provide its resource identifier. ' | ||||||||||||||||||
| 'CLI creates a new private DNS zone within the same resource group as virtual network if not provided by users.' | ||||||||||||||||||
|
Comment on lines
+271
to
+274
|
||||||||||||||||||
| 'The name or id of new or existing private DNS zone. ' | |
| 'You can use the private DNS zone from same resource group, different resource group, or different subscription. ' | |
| 'If you want to use a DNS zone from different resource group or subscription, provide its resource identifier. ' | |
| 'CLI creates a new private DNS zone within the same resource group as virtual network if not provided by users.' | |
| 'The name or resource ID of an existing private DNS zone. ' | |
| 'You can use a private DNS zone from the same resource group, a different resource group, or a different subscription. ' | |
| 'If you want to use a DNS zone from a different resource group or subscription, provide its full resource ID. ' | |
| 'The CLI does not automatically create or link private DNS zones when this parameter is omitted.' |
Copilot
AI
Mar 31, 2026
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.
The --restore-time help text is split across two adjacent string literals without a separating space/punctuation, so the rendered help will read like ...+00:00The default value.... Add a space (or period + space) at the end of the first literal or start of the second to keep the help readable.
| help='The point in time in UTC to restore from (ISO8601 format), e.g., 2026-03-22T18:20:22+00:00' | |
| help='The point in time in UTC to restore from (ISO8601 format), e.g., 2026-03-22T18:20:22+00:00 ' |
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.
--subnethelp says the subnet “will be delegated to flexibleServers”, but the refactored code path (flexible_server_validate_network+validate_subnet) only formats/returns a subnet resource ID and does not perform delegation. Either reintroduce delegation logic or update the help text so users know they must pre-delegate the subnet themselves.