-
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
Changes from 3 commits
b02011d
2f47d6a
2702d72
efe88a0
e812c9a
017c732
104b999
ad39561
a31193e
48c3b70
114283f
12e601e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,15 @@ | |
CONST_DISK_DRIVER_V2, | ||
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PUBLIC, | ||
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PRIVATE, | ||
CONST_DAILY_MAINTENANCE_SCHEDULE, | ||
CONST_WEEKLY_MAINTENANCE_SCHEDULE, | ||
CONST_ABSOLUTEMONTHLY_MAINTENANCE_SCHEDULE, | ||
CONST_RELATIVEMONTHLY_MAINTENANCE_SCHEDULE, | ||
CONST_WEEKINDEX_FIRST, | ||
CONST_WEEKINDEX_SECOND, | ||
CONST_WEEKINDEX_THIRD, | ||
CONST_WEEKINDEX_FOURTH, | ||
CONST_WEEKINDEX_LAST, | ||
) | ||
from azext_aks_preview._validators import ( | ||
validate_acr, | ||
|
@@ -133,6 +142,9 @@ | |
validate_disable_windows_outbound_nat, | ||
validate_allowed_host_ports, | ||
validate_application_security_groups, | ||
validate_utc_offset, | ||
validate_start_date, | ||
validate_start_time, | ||
) | ||
|
||
# candidates for enumeration | ||
|
@@ -177,6 +189,22 @@ | |
CONST_NONE_UPGRADE_CHANNEL, | ||
] | ||
|
||
# consts for maintenance configuration | ||
schedule_types = [ | ||
CONST_DAILY_MAINTENANCE_SCHEDULE, | ||
CONST_WEEKLY_MAINTENANCE_SCHEDULE, | ||
CONST_ABSOLUTEMONTHLY_MAINTENANCE_SCHEDULE, | ||
CONST_RELATIVEMONTHLY_MAINTENANCE_SCHEDULE, | ||
] | ||
|
||
week_indexes = [ | ||
CONST_WEEKINDEX_FIRST, | ||
CONST_WEEKINDEX_SECOND, | ||
CONST_WEEKINDEX_THIRD, | ||
CONST_WEEKINDEX_FOURTH, | ||
CONST_WEEKINDEX_LAST, | ||
] | ||
|
||
# consts for credential | ||
credential_formats = [CONST_CREDENTIAL_FORMAT_AZURE, CONST_CREDENTIAL_FORMAT_EXEC] | ||
|
||
|
@@ -570,6 +598,31 @@ def load_arguments(self, _): | |
'--weekday'], help='weekday on which maintenance can happen. e.g. Monday', required=False) | ||
c.argument('start_hour', type=int, options_list=[ | ||
'--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am', required=False) | ||
c.argument('schedule_type', options_list=['--schedule-type'], arg_type=get_enum_type(schedule_types), | ||
help='Schedule type for non-default maintenance configuration.', required=False) | ||
c.argument('interval_days', options_list=['--interval-days'], type=int, | ||
help='The number of days between each set of occurrences for Daily schedule.', required=False) | ||
c.argument('interval_weeks', options_list=['--interval-weeks'], type=int, | ||
help='The number of weeks between each set of occurrences for Weekly schedule.', required=False) | ||
c.argument('interval_months', options_list=['--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', options_list=['--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', options_list=['--day-of-month'], | ||
help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.', required=False) | ||
c.argument('week_index', options_list=['--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.', required=False) | ||
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 commentThe 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 Also you could omit There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 |
||
c.argument('utc_offset', options_list=[ | ||
'--utc-offset'], validator=validate_utc_offset, help='The UTC offset in format +/-HH:mm. e.g. -08:00 or +05:30.', required=False) | ||
c.argument('start_date', options_list=[ | ||
'--start-date'], validator=validate_start_date, | ||
help='The date the maintenance window activates. e.g. 2023-01-01.', required=False) | ||
c.argument('start_time', options_list=['--start-time'], | ||
validator=validate_start_time, | ||
help='The start time of the maintenance window. e.g. 09:30.', required=False) | ||
|
||
for scope in ['aks maintenanceconfiguration show', 'aks maintenanceconfiguration delete']: | ||
with self.argument_context(scope) as c: | ||
|
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.
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!