Skip to content
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

Add Maintenance Config Support #8190

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

p-bouchon
Copy link
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

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.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copy link

azure-client-tools-bot-prd bot commented Oct 23, 2024

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd containerapp env maintenance-config sub group containerapp env maintenance-config added

Copy link

Hi @p-bouchon,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 23, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

Copy link

Hi @p-bouchon

Release Suggestions

Module: containerapp

  • Update VERSION to 1.0.0b4 in src/containerapp/setup.py

Notes

@yonzhan yonzhan requested review from zhoxing-ms and yanzhudd and removed request for jsntcy and kairu-ms October 23, 2024 23:58
@yonzhan yonzhan assigned zhoxing-ms and unassigned kairu-ms Oct 23, 2024
@@ -8,6 +8,7 @@ upcoming
* 'az containerapp containerapp create/up': `--registry-server` and `--source` use managed identity for image pull by default
* 'az containerapp containerapp create': `--registry-server` use managed identity for image pull by default. `--no-wait` will not take effect with system registry identity.
* 'az containerapp env java-component gateway-for-spring': Support create/update/show/delete Gateway for spring.
* 'az containerapp env maintenance-config': Support Add, Update, Show, Delete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you get ack from PMs with maintenance-config change since doc has different values

image


if no_wait:
return r.json()
elif r.status_code == 201:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if no_wait:
return # API doesn't return JSON (it returns no content)
elif r.status_code in [200, 201, 202, 204]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

201 polling is not handled and also invalid for delete operations. Refer https://github.com/cloud-and-ai-microsoft/resource-provider-contract/blob/master/v1.0/async-api-reference.md#delete-resource-asynchronously

For this api, we only return 200. Still future proofing is good.

# Maintenance Config Commands
helps['containerapp env maintenance-config add'] = """
type: command
short-summary: Add a Maintenance Configuration to a Container App Environment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to update description based PM final decision. Example:

Suggested change
short-summary: Add a Maintenance Configuration to a Container App Environment
short-summary: Add a Scheduled Maintenance to a Container App Environment

type: command
short-summary: Add a Maintenance Configuration to a Container App Environment
examples:
- name: Configure an Env to use a maintenance config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: To have full name for descriptions. PM can contribute here

Suggested change
- name: Configure an Env to use a maintenance config
- name: Configure a Container App Environment to use a maintenance configuration

with self.argument_context('containerapp env maintenance-config') as c:
c.argument('weekday', options_list=['--weekday', '-w'], arg_type=get_enum_type(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]), help="The weekday to schedule the maintenance configuration.")
c.argument('start_hour_utc', options_list=['--start-hour-utc', '-s'], help="The hour to start the maintenance configuration.")
c.argument('duration', options_list=['--duration', '-d'], help="The duration in hours of the maintenance configuration.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since, you have it in validation

Suggested change
c.argument('duration', options_list=['--duration', '-d'], help="The duration in hours of the maintenance configuration.")
c.argument('duration', options_list=['--duration', '-d'], help="The duration in hours of the maintenance configuration. Minimum value: 8")

@@ -370,6 +370,11 @@ def load_arguments(self, _):
c.argument('max_replicas', type=int, help="Maximum number of replicas to run for the Java component.")
c.argument('route_yaml', options_list=['--route-yaml', '--yaml'], help="Path to a .yaml file with the configuration of a Spring Cloud Gateway route. For an example, see https://aka.ms/gateway-for-spring-routes-yaml")

with self.argument_context('containerapp env maintenance-config') as c:
c.argument('weekday', options_list=['--weekday', '-w'], arg_type=get_enum_type(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ]), help="The weekday to schedule the maintenance configuration.")
c.argument('start_hour_utc', options_list=['--start-hour-utc', '-s'], help="The hour to start the maintenance configuration.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
c.argument('start_hour_utc', options_list=['--start-hour-utc', '-s'], help="The hour to start the maintenance configuration.")
c.argument('start_hour_utc', options_list=['--start-hour-utc', '-s'], help="The hour to start the maintenance configuration. Valid value from 0 to 23")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants