Skip to content

Commit 884bfa3

Browse files
nasc17khang-11
authored andcommitted
{POSTGRESQL} az postgres flexible-server create/upgrade/migrate-network: Update help and warning text for migrate network and unsupported version (Azure#32958)
1 parent f83b9fc commit 884bfa3

3 files changed

Lines changed: 10 additions & 19 deletions

File tree

src/azure-cli/azure/cli/command_modules/postgresql/_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@
360360

361361
helps['postgres flexible-server migrate-network'] = """
362362
type: command
363-
short-summary: Migrate the network mode of a flexible server.
363+
short-summary: Migrate an Azure Database for PostgreSQL server from VNet integration to a Private Link network model.
364364
examples:
365-
- name: Migrate the network mode of a flexible server.
365+
- name: Migrate an Azure Database for PostgreSQL server from VNet integration to a Private Link network model.
366366
text: az postgres flexible-server migrate-network --resource-group testGroup --name testserver
367367
"""
368368

src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55

66
# pylint: disable=unused-argument, line-too-long
77
from azure.cli.core.util import user_confirmation
8-
from knack.log import get_logger
98
from knack.util import CLIError
109
from .._client_factory import cf_postgres_flexible_replica
1110
from ..utils._flexible_server_location_capabilities_util import get_postgres_server_capability_info
1211
from ..utils._flexible_server_util import resolve_poller
13-
from ..utils.validators import validate_citus_cluster, validate_resource_group
14-
15-
logger = get_logger(__name__)
16-
# pylint: disable=raise-missing-from
12+
from ..utils.validators import pg_version_validator, validate_citus_cluster, validate_resource_group
1713

1814

1915
def flexible_server_version_upgrade(cmd, client, resource_group_name, server_name, version, yes=None):
@@ -35,10 +31,7 @@ def flexible_server_version_upgrade(cmd, client, resource_group_name, server_nam
3531
list_server_capability_info = get_postgres_server_capability_info(cmd, resource_group_name, server_name)
3632
eligible_versions = list_server_capability_info['supported_server_versions'][str(current_version)]
3733

38-
if version == '13':
39-
logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. "
40-
"Upgrade to PostgreSQL 14 or later as soon as possible to "
41-
"maintain security, performance, and supportability.")
34+
pg_version_validator(version, eligible_versions)
4235

4336
if version not in eligible_versions:
4437
# version not supported

src/azure-cli/azure/cli/command_modules/postgresql/utils/validators.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def pg_arguments_validator(db_context, location, tier, sku_name, storage_gb, ser
197197
_pg_sku_name_validator(sku_name, sku_info, tier, instance)
198198
_pg_high_availability_validator(high_availability, zonal_resiliency, allow_same_zone,
199199
standby_availability_zone, zone, tier, single_az, instance)
200-
_pg_version_validator(version, list_location_capability_info['server_versions'])
200+
pg_version_validator(version, list_location_capability_info['server_versions'])
201201
pg_byok_validator(byok_identity, byok_key, backup_byok_identity, backup_byok_key, geo_redundant_backup, instance)
202202
is_microsoft_entra_auth = bool(microsoft_entra_auth is not None and microsoft_entra_auth.lower() == 'enabled')
203203
_pg_authentication_validator(password_auth, is_microsoft_entra_auth,
@@ -342,16 +342,14 @@ def _pg_storage_performance_tier_validator(performance_tier, sku_info, tier=None
342342
' Allowed values : {}'.format(storage_size, performance_tiers))
343343

344344

345-
def _pg_version_validator(version, versions):
345+
def pg_version_validator(version, versions):
346346
if version:
347347
if version not in versions:
348348
raise CLIError('Incorrect value for --version. Allowed values : {}'.format(sorted(versions)))
349-
if version in ('11', '12'):
350-
logger.warning("Support for PostgreSQL %s has officially ended. "
351-
"We recommend selecting PostgreSQL 14 or a later version for "
352-
"all future operations.", str(version))
353-
if version == '13':
354-
logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. "
349+
if version in ('11', '12', '13'):
350+
logger.warning("The version selected is a retired community version of PostgreSQL. "
351+
"To use this version, you will automatically be enrolled in our extended "
352+
"support plan for an additional charge starting August 1, 2026. "
355353
"Upgrade to PostgreSQL 14 or later as soon as possible to "
356354
"maintain security, performance, and supportability.")
357355

0 commit comments

Comments
 (0)