Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
8 changes: 7 additions & 1 deletion src/fleet/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,10 @@ Release History

1.5.2
++++++
* Bug fix for `az fleet create --enable-hub --enable-private-cluster` argument
* Bug fix for `az fleet create --enable-hub --enable-private-cluster` argument

1.6.0
++++++
* Upgrade SDK version to 2025-04-01-preview
* Add Fleet Gates support
* Add TargetKubernetesVersion channel support
2 changes: 1 addition & 1 deletion src/fleet/azext_fleet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def register_fleet_resource_type():
register_resource_type(
"latest",
CUSTOM_MGMT_FLEET,
SDKProfile("2025-03-01"),
SDKProfile("2025-04-01-preview"),
)


Expand Down
2 changes: 2 additions & 0 deletions src/fleet/azext_fleet/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def cf_fleets(cli_ctx, *_):
def cf_fleet_members(cli_ctx, *_):
return get_container_service_client(cli_ctx).fleet_members

def cf_gates(cli_ctx, *_):
return get_container_service_client(cli_ctx).gates

def cf_update_runs(cli_ctx, *_):
return get_container_service_client(cli_ctx).update_runs
Expand Down
13 changes: 13 additions & 0 deletions src/fleet/azext_fleet/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,16 @@
short-summary: Wait for an auto upgrade resource to reach a desired state.
long-summary: If an operation on an auto upgrade profile was interrupted or was started with `--no-wait`, use this command to wait for it to complete.
"""

helps['fleet gate'] = """
type: group
short-summary: Commands to manage gates.
"""

helps['fleet gate list'] = """
type: command
short-summary: Lists all gates under a fleet.
examples:
- name: Lists all gates under a fleet.
text: az fleet list -g MyFleetResourceGroup --fleet-name MyFleetName
"""
27 changes: 24 additions & 3 deletions src/fleet/azext_fleet/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,22 @@ def load_arguments(self, _):
with self.argument_context('fleet autoupgradeprofile create') as c:
c.argument('update_strategy_id', validator=validate_update_strategy_id,
help='The resource ID of the update strategy that the auto upgrade profile should follow.')
c.argument('channel', options_list=['--channel', '-c'], arg_type=get_enum_type(['Stable', 'Rapid', 'NodeImage']),
c.argument('channel', options_list=['--channel', '-c'], arg_type=get_enum_type(['Stable', 'Rapid', 'NodeImage', 'TargetKubernetesVersion']),
help='The auto upgrade channel type.')
c.argument('node_image_selection', arg_type=get_enum_type(['Latest', 'Consistent']),
help='Node Image Selection is an option that lets you choose how your clusters\' nodes are upgraded')
help='Node Image Selection is an option that lets you choose how your clusters\' nodes are upgraded.')
c.argument('target_kubernetes_version',
help=(
'This is the target Kubernetes version for auto-upgrade. The format must be "{major version}.{minor version}". '
'For example, "1.30". By default, this is empty. '
'If the upgrade channel is set to TargetKubernetesVersion, this field must not be empty. '
'If the upgrade channel is Rapid, Stable, or NodeImage, this field must be empty.'
)
)
c.argument('disabled', action='store_true',
help='The disabled flag ensures auto upgrade profile does not run by default')
help='The disabled flag ensures auto upgrade profile does not run by default.')
c.argument('long_term_support', action='store_true',
help='If upgrade channel is not TargetKubernetesVersion, this field must be False. If set to True: Fleet auto upgrade will continue generate update runs for patches of minor versions earlier than N-2 (where N is the latest supported minor version) if those minor versions support Long-Term Support (LTS). By default, this is set to False.')

with self.argument_context('fleet autoupgradeprofile wait') as c:
c.argument('auto_upgrade_profile_name', options_list=['--auto-upgrade-profile-name', '--profile-name'],
Expand All @@ -115,3 +125,14 @@ def load_arguments(self, _):
c.argument('resource_group_name', options_list=['--resource-group', '-g'], help='Name of the resource group.')
c.argument('fleet_name', options_list=['--fleet-name', '-f'], help='Name of the fleet.')
c.argument('auto_upgrade_profile_name', options_list=['--auto-upgrade-profile-name', '--profile-name', '--name', '-n'], help='Name of the auto upgrade profile.')


with self.argument_context('fleet gate list') as c:
c.argument('resource_group_name', options_list=['--resource-group', '-g'], help='Name of the resource group.')
c.argument('fleet_name', options_list=['--fleet-name', '-f'], help='Name of the fleet.')

with self.argument_context('fleet gate get') as c:
c.argument('resource_group_name', options_list=['--resource-group', '-g'], help='Name of the resource group.')
c.argument('fleet_name', options_list=['--fleet-name', '-f'], help='Name of the fleet.')
c.argument('gate_name', options_list=['--gate-name', '-n'], help='Name of the gate.')

16 changes: 14 additions & 2 deletions src/fleet/azext_fleet/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
cf_update_runs,
cf_fleet_update_strategies,
cf_auto_upgrade_profiles,
cf_auto_upgrade_profile_operations

cf_auto_upgrade_profile_operations,
cf_gates
)


Expand Down Expand Up @@ -54,6 +54,12 @@ def load_command_table(self, _):
client_factory=cf_auto_upgrade_profile_operations
)

gates_sdk = CliCommandType(
operations_tmpl="azext_fleet.vendored_sdks.operations._gates_operations#GatesOperations.{}",
operation_group="gates",
client_factory=cf_gates
)

# fleets command group
with self.command_group("fleet", fleets_sdk, client_factory=cf_fleets) as g:
g.custom_command("create", "create_fleet", supports_no_wait=True)
Expand Down Expand Up @@ -105,3 +111,9 @@ def load_command_table(self, _):
# auto upgrade profiles operation command group
with self.command_group("fleet autoupgradeprofile", auto_upgrade_profile_operations_sdk, client_factory=cf_auto_upgrade_profile_operations) as g:
g.custom_command("generate-update-run", "generate_update_run", supports_no_wait=True)

# fleet gates command group
with self.command_group("fleet gate", gates_sdk, client_factory=cf_gates) as g:
g.custom_command("list", "list_gates_by_fleet")
g.custom_command("get", "get_gates")
g.wait_command("wait")
17 changes: 17 additions & 0 deletions src/fleet/azext_fleet/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ def create_auto_upgrade_profile(cmd, # pylint: disable=unused-argument
channel,
update_strategy_id=None,
node_image_selection=None,
target_kubernetes_version=None,
long_term_support=False,
disabled=False,
no_wait=False):

Expand Down Expand Up @@ -574,6 +576,8 @@ def create_auto_upgrade_profile(cmd, # pylint: disable=unused-argument
update_strategy_id=update_strategy_id,
channel=upgrade_channel,
node_image_selection=auto_upgrade_node_image_selection,
target_kubernetes_version=target_kubernetes_version,
long_term_support=long_term_support,
disabled=disabled
)

Expand Down Expand Up @@ -622,3 +626,16 @@ def generate_update_run(cmd, # pylint: disable=unused-argument
fleet_name,
auto_upgrade_profile_name
)

def list_gates_by_fleet(cmd, # pylint: disable=unused-argument
client,
resource_group_name,
fleet_name):
return client.list_by_fleet(resource_group_name, fleet_name)

def get_gates(cmd, # pylint: disable=unused-argument
client,
resource_group_name,
fleet_name,
gate_name):
return client.get(resource_group_name, fleet_name, gate_name)
Loading
Loading