Skip to content

Commit 41a6727

Browse files
committed
add warning msg to az sig image-version create/update
1 parent 6602831 commit 41a6727

3 files changed

Lines changed: 33 additions & 27 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,3 @@ cmd_coverage/*
122122

123123
# Ignore test results
124124
test_results.xml
125-
126-
_scratch*

src/azure-cli/azure/cli/command_modules/vm/_breaking_change.py

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,38 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
5-
from azure.cli.core.breaking_change import register_default_value_breaking_change
5+
from azure.cli.core.breaking_change import register_default_value_breaking_change, register_other_breaking_change
66

7-
register_default_value_breaking_change(command_name='vm create',
8-
arg='--size',
9-
current_default='Standard_DS1_v2',
10-
new_default='Standard_D2s_v5',
11-
target_version=None)
7+
register_default_value_breaking_change(
8+
command_name="vm create",
9+
arg="--size",
10+
current_default="Standard_DS1_v2",
11+
new_default="Standard_D2s_v5",
12+
target_version=None,
13+
)
1214

13-
register_default_value_breaking_change(command_name='vmss create',
14-
arg='--vm-sku',
15-
current_default='Standard_DS1_v2',
16-
new_default='Standard_D2s_v5',
17-
target_version=None)
15+
register_default_value_breaking_change(
16+
command_name="vmss create",
17+
arg="--vm-sku",
18+
current_default="Standard_DS1_v2",
19+
new_default="Standard_D2s_v5",
20+
target_version=None,
21+
)
22+
23+
register_other_breaking_change(
24+
"sig image-version create",
25+
"Starting api-version 2026-03-03, gallery image versions will default to:\n"
26+
" - endOfLifeDate = 6 months from publish date (unless explicitly set)\n"
27+
" - blockDeletionBeforeEndOfLife = true (unless explicitly set)\n"
28+
"By default, image deletion is blocked for 6 months. "
29+
"To override, set a custom endOfLifeDate or set blockDeletionBeforeEndOfLife = false",
30+
)
31+
32+
register_other_breaking_change(
33+
"sig image-version update",
34+
"Starting api-version 2026-03-03, gallery image versions will default to:\n"
35+
" - endOfLifeDate = 6 months from publish date (unless explicitly set)\n"
36+
" - blockDeletionBeforeEndOfLife = true (unless explicitly set)\n"
37+
"By default, image deletion is blocked for 6 months. "
38+
"To override, set a custom endOfLifeDate or set blockDeletionBeforeEndOfLife = false",
39+
)

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5341,13 +5341,6 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n
53415341
from azure.mgmt.core.tools import resource_id, is_valid_resource_id
53425342
from azure.cli.core.commands.client_factory import get_subscription_id
53435343

5344-
# Display warning about API version 2026-03-03 changes
5345-
logger.warning("Starting api-version 2026-03-03, gallery image versions will default to:\n"
5346-
" - endOfLifeDate = 6 months from publish date (unless explicitly set)\n"
5347-
" - blockDeletionBeforeEndOfLife = true (unless explicitly set)\n"
5348-
"By default, image deletion is blocked for 6 months. "
5349-
"To override, set a custom endOfLifeDate or set blockDeletionBeforeEndOfLife = false")
5350-
53515344
location = location or _get_resource_group_location(cmd.cli_ctx, resource_group_name)
53525345
end_of_life_date = fix_gallery_image_date_info(end_of_life_date)
53535346
if managed_image and not is_valid_resource_id(managed_image):
@@ -5562,13 +5555,6 @@ def update_image_version(cmd, resource_group_name, gallery_name, gallery_image_n
55625555
from .operations.sig_image_version import convert_show_result_to_snake_case
55635556
args = convert_show_result_to_snake_case(args)
55645557

5565-
# Display warning about API version 2026-03-03 changes
5566-
logger.warning("Starting api-version 2026-03-03, gallery image versions will default to:\n"
5567-
" - endOfLifeDate = 6 months from publish date (unless explicitly set)\n"
5568-
" - blockDeletionBeforeEndOfLife = true (unless explicitly set)\n"
5569-
"By default, image deletion is blocked for 6 months. "
5570-
"To override, set a custom endOfLifeDate or set blockDeletionBeforeEndOfLife = false")
5571-
55725558
if target_regions:
55735559
if "publishing_profile" not in args:
55745560
args["publishing_profile"] = {}

0 commit comments

Comments
 (0)