Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add upcoming breaking change announcement
  • Loading branch information
evelyn-ys committed Mar 21, 2025
commit 27b9c6fdc096b356c9836a9775547092e805b661
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from azure.cli.core.breaking_change import AzCLIOtherChange, register_conditional_breaking_change

register_conditional_breaking_change(tag='CloudRegisterOutputBreakingChange',
breaking_change=AzCLIOtherChange(cmd='cloud register',
message='In the near future, no gallery endpoint will be returned if use endpoint discovery with --endpoint-resource-manager, please manually set with --endpoint-gallery')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like #31061 (comment), should we explicitly state 2.73.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, let me update

)

register_conditional_breaking_change(tag='CloudUpdateOutputBreakingChange',
breaking_change=AzCLIOtherChange(cmd='cloud update',
message='In the near future, no gallery endpoint will be returned if use endpoint discovery with --endpoint-resource-manager, please manually set with --endpoint-gallery')
)
12 changes: 9 additions & 3 deletions src/azure-cli/azure/cli/command_modules/cloud/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _populate_from_metadata_endpoint(cloud, arm_endpoint, session=None):
raise CLIError(error_msg_fmt.format(msg))


def _build_cloud(cli_ctx, cloud_name, cloud_config=None, cloud_args=None):
def _build_cloud(cli_ctx, cloud_name, cloud_config=None, is_update=False, cloud_args=None):
from azure.cli.core.cloud import CloudEndpointNotSetException
if cloud_config:
# Using JSON format so convert the keys to snake case
Expand Down Expand Up @@ -98,6 +98,12 @@ def _build_cloud(cli_ctx, cloud_name, cloud_config=None, cloud_args=None):
except CloudEndpointNotSetException:
arm_endpoint = None

from azure.cli.core.breaking_change import print_conditional_breaking_change
if arm_endpoint and is_update:
print_conditional_breaking_change(cli_ctx, tag='CloudUpdateOutputBreakingChange')
elif arm_endpoint:
print_conditional_breaking_change(cli_ctx, tag='CloudRegisterOutputBreakingChange')

_populate_from_metadata_endpoint(c, arm_endpoint)
required_endpoints = {'resource_manager': '--endpoint-resource-manager',
'active_directory': '--endpoint-active-directory',
Expand Down Expand Up @@ -132,7 +138,7 @@ def register_cloud(cmd,
suffix_azure_datalake_store_file_system_endpoint=None,
suffix_azure_datalake_analytics_catalog_and_job_endpoint=None,
suffix_acr_login_server_endpoint=None):
c = _build_cloud(cmd.cli_ctx, cloud_name, cloud_config=cloud_config,
c = _build_cloud(cmd.cli_ctx, cloud_name, cloud_config=cloud_config, is_update=False,
cloud_args=locals())
try:
add_cloud(cmd.cli_ctx, c)
Expand Down Expand Up @@ -161,7 +167,7 @@ def modify_cloud(cmd,
suffix_acr_login_server_endpoint=None):
if not cloud_name:
cloud_name = cmd.cli_ctx.cloud.name
c = _build_cloud(cmd.cli_ctx, cloud_name, cloud_config=cloud_config,
c = _build_cloud(cmd.cli_ctx, cloud_name, cloud_config=cloud_config, is_update=True,
cloud_args=locals())
try:
update_cloud(cmd.cli_ctx, c)
Expand Down