From 1e8ddd6475328ab89d2a2830db759df983a0eeea Mon Sep 17 00:00:00 2001 From: Matthew Boentoro Date: Mon, 16 Jun 2025 13:57:22 -0700 Subject: [PATCH 1/2] {RDBMS} az postgres flexible-server create/update/upgrade: Add eol message for PG 11 and 13 --- .../rdbms/flexible_server_custom_common.py | 5 +++++ .../azure/cli/command_modules/rdbms/validators.py | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py index f9c68ce5688..fd9ff4d6102 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py @@ -302,6 +302,11 @@ def flexible_server_version_upgrade(cmd, client, resource_group_name, server_nam list_server_capability_info = get_postgres_server_capability_info(cmd, resource_group_name, server_name) eligible_versions = list_server_capability_info['supported_server_versions'][str(current_version)] + + if version == '13': + logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. " + "Upgrade to PostgreSQL 14 or later as soon as possible to " + "maintain security, performance, and supportability.") if version not in eligible_versions: # version not supported diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/validators.py b/src/azure-cli/azure/cli/command_modules/rdbms/validators.py index 11bb270e963..22ad3defbf9 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/validators.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/validators.py @@ -514,10 +514,18 @@ def _pg_version_validator(version, versions): if version: if version not in versions: raise CLIError('Incorrect value for --version. Allowed values : {}'.format(sorted(versions))) + if version == '11': + raise CLIError("Support for PostgreSQL 11 has officially ended. " + "We recommend selecting PostgreSQL 14 or a later version for " + "all future operations.") if version == '12': raise CLIError("Support for PostgreSQL 12 has officially ended. " - "We recommend selecting PostgreSQL 13 or a later version for " + "We recommend selecting PostgreSQL 14 or a later version for " "all future operations.") + if version == '13': + logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. " + "Upgrade to PostgreSQL 14 or later as soon as possible to " + "maintain security, performance, and supportability.") def _pg_high_availability_validator(high_availability, standby_availability_zone, zone, tier, single_az, instance): From 889d5614595705b8b1262f0feb49571c044dcc18 Mon Sep 17 00:00:00 2001 From: Matthew Boentoro Date: Mon, 16 Jun 2025 14:03:58 -0700 Subject: [PATCH 2/2] fix lint --- .../rdbms/flexible_server_custom_common.py | 2 +- .../azure/cli/command_modules/rdbms/validators.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py index fd9ff4d6102..81438988ab0 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py @@ -302,7 +302,7 @@ def flexible_server_version_upgrade(cmd, client, resource_group_name, server_nam list_server_capability_info = get_postgres_server_capability_info(cmd, resource_group_name, server_name) eligible_versions = list_server_capability_info['supported_server_versions'][str(current_version)] - + if version == '13': logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. " "Upgrade to PostgreSQL 14 or later as soon as possible to " diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/validators.py b/src/azure-cli/azure/cli/command_modules/rdbms/validators.py index 22ad3defbf9..cf4813e9686 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/validators.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/validators.py @@ -516,16 +516,16 @@ def _pg_version_validator(version, versions): raise CLIError('Incorrect value for --version. Allowed values : {}'.format(sorted(versions))) if version == '11': raise CLIError("Support for PostgreSQL 11 has officially ended. " - "We recommend selecting PostgreSQL 14 or a later version for " - "all future operations.") + "We recommend selecting PostgreSQL 14 or a later version for " + "all future operations.") if version == '12': raise CLIError("Support for PostgreSQL 12 has officially ended. " "We recommend selecting PostgreSQL 14 or a later version for " "all future operations.") if version == '13': logger.warning("PostgreSQL version 13 will reach end-of-life (EOL) soon. " - "Upgrade to PostgreSQL 14 or later as soon as possible to " - "maintain security, performance, and supportability.") + "Upgrade to PostgreSQL 14 or later as soon as possible to " + "maintain security, performance, and supportability.") def _pg_high_availability_validator(high_availability, standby_availability_zone, zone, tier, single_az, instance):