[AKS] az aks maintenanceconfiguration add/update: Add support for maintenanceWindow format in default maintenance configuration#33431
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @anushkasingh16, |
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Enable --schedule-type (Weekly-only) for the default AKS maintenance configuration using the maintenanceWindow format, and update CLI help/docs and tests accordingly.
Changes:
- Allow
--schedule-type Weeklyfor default maintenance configuration and constructmaintenance_windowpayload. - Add negative tests validating default-config argument constraints for
--schedule-typeand--interval-weeks. - Update parameter/help text and add CLI examples for default maintenanceWindow schedules.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acs/maintenanceconfiguration.py | Adds schedule_type handling for default config and builds maintenance_window model |
| src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_maintenanceconfiguration.py | Updates/extends tests for default config schedule-type validation |
| src/azure-cli/azure/cli/command_modules/acs/_params.py | Clarifies --schedule-type help now that default supports Weekly |
| src/azure-cli/azure/cli/command_modules/acs/_help.py | Adds examples and updates help text to mention default Weekly-only support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
nit: validation gap — for default config with also the example text says "in UTC every week" but the maintenanceWindow path supports |
|
Please fix the failed CI check Azure.azure-cli (Check the Format of Pull Request Title and Content), @anushkasingh16 |
az aks maintenanceconfiguration add/update: Add support for maintenanceWindow format in default maintenance configuration
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
prior threads addressed:
No vote. |
Code reviewWhat this PR does (as built)Adds a Suggested change in directionThis PR ships in a new CLI major version, so we have a one-time opportunity to stop emitting
Either way, the result is: after this CLI version ships, no CLI invocation can produce a Note this is a breaking change in Issues in the current code1. Misleading error when 2. Mutation of caller's dict (low). raw_parameters["interval_weeks"] = 1mutates the dict the caller owns. Today nothing downstream re-reads it, but the function is presented as a pure "construct" function. Cleaner: pass 3. Inconsistent exception types for similar rejections (low). 4. Bulk error doesn't identify the offending flag (low). if any(raw_parameters.get(p) is not None for p in ("interval_days", "interval_months", "day_of_month", "week_index")):
raise MutuallyExclusiveArgumentError('--interval-days, --interval-months, --day-of-month and --week-index cannot be used ...')User gets a kitchen-sink message. Trivial improvement: offending = [p for p in (...) if raw_parameters.get(p) is not None]
if offending:
flags = ", ".join("--" + p.replace("_", "-") for p in offending)
raise MutuallyExclusiveArgumentError(f'{flags} cannot be used for default maintenance configuration.')5. Cosmetic rename adds noise (low). 6. Help text length (nit). 7. DRY in tests (low). 8. Missing test coverage (medium). 9. No test for Looks fine
|
Related issues worth referencingPR has no
If the team is tracking the work internally in ADO instead, please link the ADO item in the PR description so reviewers can find the design context. Pre-existing bug not introduced by this PR but worth flaggingThe legacy path's error message in
… is now wrong in this PR (it doesn't mention the new |
Related command
az aks maintenanceconfiguration add
az aks maintenanceconfiguration update
Description
Previously, the default maintenance configuration only supported the legacy timeInWeek format (using --weekday and --start-hour).
The AKS RP API (since 2023-05-01) also supports the maintenanceWindow format for the default config, but the CLI was blocking it by raising an error when --schedule-type was provided for the default config.
This PR removes that restriction and allows users to use --schedule-type Weekly with the default maintenance configuration name, which routes to the maintenanceWindow format. The RP enforces that only Weekly schedule with intervalWeeks=1 is valid for the default config (since API version 2025-03-01), so the CLI validates this client-side as well.
The legacy --weekday --start-hour path continues to work unchanged for backward compatibility.
Testing Guide
History Notes
[AKS]
az aks maintenanceconfiguration add/update: Add--schedule-typeWeekly support for default maintenance configuration using the maintenanceWindow formatThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.