-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update maintenanceconfiguration commands #5739
Conversation
AKS |
Hi @FumingZhang and @zhoxing-ms, I have addressed all the comments, could you help take another look? Many thanks!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but something related to monitoring addon broken due a recent update on azure-cli/acs. Please hold the PR until that's fixed.
c.argument('duration_hours', options_list=['--duration'], type=int, | ||
help='The length of maintenance window. The value ranges from 4 to 24 hours.', required=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this is the only argument which has some difference between parameter and the option. Then you could omit the options_list
for all other arguments.
Also you could omit required=False
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix (#5744) is merged. Please rebase from main then I would trigger (or you could rerun the previous one) a live test run for your newly added case. Previous one skipped the tests in aks-preview due to the breaking change in azure-cli/acs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @FumingZhang!
I have rebased to the main branch and re-runed the live test. I also removed all the options_list
for all arguments except duration_hours
. When I tried to remove required=False
, CLI Linter gave me failure saying I'm missing required arguments in help file, so I left them there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Live test passed.
Hi @zhoxing-ms, could you help merge this PR? Many thanks!! |
src/aks-preview/HISTORY.rst
Outdated
@@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to | |||
Pending | |||
+++++++ | |||
|
|||
0.5.123 | |||
+++++++ | |||
* Update command group `az aks maintenanceconfiguration` to enable the creation of *aksManagedAutoUpgradeSchedule* and *aksManagedNodeOSUpgradeSchedule*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aksManagedAutoUpgradeSchedule and aksManagedNodeOSUpgradeSchedule
Could we describe these two features in detail in the history notes, otherwise their meaning is easily confusing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback, I have updated the details!
short-summary: Specifies the number of days between each set of occurrences for daily schedule type. | ||
- name: --interval-weeks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
short-summary: Specifies the number of days between each set of occurrences for daily schedule type. | |
- name: --interval-weeks | |
short-summary: Specify the number of days between each set of occurrences for daily schedule type. | |
- name: --interval-weeks |
Please use the first-person voice in the help message, and other places are similar. Please modify these voices uniformly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
c.argument('start_hour', type=int, required=False, options_list=[ | ||
'--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.argument('start_hour', type=int, required=False, options_list=[ | |
'--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') | |
c.argument('start_hour', type=int, help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') |
Because required=False
and options_list=['--start-hour']
is the default setting, so there is no need to explicitly repeat the definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All required=False
and unwanted options_list
have been removed
c.argument('schedule_type', arg_type=get_enum_type(schedule_types), | ||
help='Schedule type for non-default maintenance configuration.', required=False) | ||
c.argument('interval_days', type=int, help='The number of days between each set of occurrences for Daily schedule.', required=False) | ||
c.argument('interval_weeks', type=int, help='The number of weeks between each set of occurrences for Weekly schedule.', required=False) | ||
c.argument('interval_months', type=int, help='The number of months between each set of occurrences for AbsoluteMonthly or RelativeMonthly schedule.', required=False) | ||
c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.', required=False) | ||
c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.', required=False) | ||
c.argument('week_index', arg_type=get_enum_type(week_indexes), required=False, | ||
help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.') | ||
c.argument('duration_hours', options_list=['--duration'], type=int, required=False, | ||
help='The length of maintenance window. The value ranges from 4 to 24 hours.') | ||
c.argument('utc_offset', validator=validate_utc_offset, required=False, | ||
help='The UTC offset in format +/-HH:mm. e.g. -08:00 or +05:30.') | ||
c.argument('start_date', validator=validate_start_date, required=False, | ||
help='The date the maintenance window activates. e.g. 2023-01-01.') | ||
c.argument('start_time', validator=validate_start_time, required=False, | ||
help='The start time of the maintenance window. e.g. 09:30.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required=False
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: I have to add required=False
back in order to pass Linter and Live tests T^T . I posted the question in the Azure CLI channel: https://teams.microsoft.com/l/message/19:[email protected]/1673502442579?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=9a661795-1b01-4a5b-9dd5-be571422334c&parentMessageId=1673502442579&teamName=Azure%20CLIs%20partners&channelName=Azure%20CLI&createdTime=1673502442579&allowXTenantAccess=false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update again: required=False
are removed!
Hi @zhoxing-ms, I have addresses you comments. Could you help take another look? Thanks in advance!! |
c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.') | ||
c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.') | ||
c.argument('week_index', arg_type=get_enum_type(week_indexes), | ||
help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.') | |
c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.') | |
c.argument('week_index', arg_type=get_enum_type(week_indexes), | |
help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.') | |
c.argument('day_of_week', help='Specify on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.') | |
c.argument('day_of_month', help='Specify on which date of the month the maintenance occurs for AbsoluteMonthly schedule.') | |
c.argument('week_index', arg_type=get_enum_type(week_indexes), | |
help='Specify on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry I missed these. They have been fixed!
c.argument('weekday', help='weekday on which maintenance can happen. e.g. Monday') | ||
c.argument('start_hour', type=int, help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.argument('weekday', help='weekday on which maintenance can happen. e.g. Monday') | |
c.argument('start_hour', type=int, help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') | |
c.argument('weekday', help='Weekday on which maintenance can happen. e.g. Monday') | |
c.argument('start_hour', type=int, help='Maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use mocked time instead of real time.
'auto_upgrade_config_name': 'aksManagedAutoUpgradeSchedule', | ||
'node_os_upgrade_config_name': 'aksManagedNodeOSUpgradeSchedule', | ||
'ssh_key_value': self.generate_ssh_keys(), | ||
'future_date': (datetime.datetime.now() + datetime.timedelta(days=10)).strftime("%Y-%m-%d") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondered why the recording test failed based on previous commit.
It's not a good idea to use real time instead of mocked time in e2e test, which would fail the recording test later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have modified the test to use a fixed future date. Thanks for the explanation!
@wenxuan0923 Could you please resolve these conflicts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Queue another live test to do the final verification. Looks good!
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks maintenanceconfiguration add
az aks maintenanceconfiguration update
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json
.