-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
support acs gen2 #6402
support acs gen2 #6402
Conversation
Hi @leonard520, |
Thank you for your contribution! We will review the pull request and get back to you soon. |
Please fix the CI |
src/spring/HISTORY.md
Outdated
* Add new command -- `az spring application-configuration-service create --generation` to support create Application Configuration Service with different generation | ||
* Add new command -- `az spring application-configuration-service update --generation` to support update Application Configuration Service to different generation | ||
* Add new command -- `az spring application-configuration-service git repo add --ca-cert-name` to support bind certificate to Application Configuration Service Gen2 |
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.
* Add new command -- `az spring application-configuration-service create --generation` to support create Application Configuration Service with different generation | |
* Add new command -- `az spring application-configuration-service update --generation` to support update Application Configuration Service to different generation | |
* Add new command -- `az spring application-configuration-service git repo add --ca-cert-name` to support bind certificate to Application Configuration Service Gen2 | |
* Add new command -- `az spring application-configuration-service create --generation` to support creating Application Configuration Service with different generation | |
* Add new command -- `az spring application-configuration-service update --generation` to support updating Application Configuration Service to different generation | |
* Add new command -- `az spring application-configuration-service git repo add --ca-cert-name` to support binding certificate to Application Configuration Service Gen2 |
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.
updated
src/spring/azext_spring/_params.py
Outdated
c.argument('application_configuration_service_generation', | ||
arg_group="Application Configuration Service", | ||
type=ConfigurationServiceGeneration, | ||
options_list=['--application-configuration-service-generation', '--acs-gen'], | ||
validator=validate_acs_create, | ||
help='(Enterprise Tier Only) Application Configuration Service Generation to enable. Allowed values are: ' + ', '.join(list(ConfigurationServiceGeneration))) | ||
c.argument('enable_application_live_view', |
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.
If this parameter has limited values, please add arg_type=get_enum_type(ConfigurationServiceGeneration)
for the parameter and it is not necessay to specify the avaiable values manually in help
.
c.argument('application_configuration_service_generation', | |
arg_group="Application Configuration Service", | |
type=ConfigurationServiceGeneration, | |
options_list=['--application-configuration-service-generation', '--acs-gen'], | |
validator=validate_acs_create, | |
help='(Enterprise Tier Only) Application Configuration Service Generation to enable. Allowed values are: ' + ', '.join(list(ConfigurationServiceGeneration))) | |
c.argument('enable_application_live_view', | |
c.argument('application_configuration_service_generation', | |
arg_group="Application Configuration Service", | |
arg_type=get_enum_type(ConfigurationServiceGeneration), | |
options_list=['--application-configuration-service-generation', '--acs-gen'], | |
validator=validate_acs_create, | |
help='(Enterprise Tier Only) Application Configuration Service Generation to enable.) | |
c.argument('enable_application_live_view', |
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! updated
src/spring/azext_spring/_params.py
Outdated
@@ -810,6 +817,10 @@ def prepare_logs_argument(c): | |||
with self.argument_context('spring application-configuration-service {}'.format(scope)) as c: | |||
c.argument('app', app_name_type, help='Name of app.', validator=validate_app_name) | |||
|
|||
for scope in ['create', 'update']: | |||
with self.argument_context('spring application-configuration-service {}'.format(scope)) as c: | |||
c.argument('generation', type=ConfigurationServiceGeneration, help='Generation. Allowed values are: ' + ', '.join(list(ConfigurationServiceGeneration))) |
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.
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.
updated
def validate_acs_create(namespace): | ||
if namespace.application_configuration_service_generation is not None: | ||
if namespace.enable_application_configuration_service is False: | ||
raise ArgumentUsageError("--application_configuration_service_generation can only be set when enable application configuration service.") |
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.
raise ArgumentUsageError("--application_configuration_service_generation can only be set when enable application configuration service.") | |
raise ArgumentUsageError("--application-configuration-service-generation can only be set when enable application configuration service.") |
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
if namespace.generation is None: | ||
return | ||
if (namespace.generation not in list(ConfigurationServiceGeneration)): | ||
raise InvalidArgumentValueError("Allowed generation are: " + ', '.join(list(ConfigurationServiceGeneration))) |
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.
After adding arg_type=get_enum_type()
to the parameter, it is not necessary to valid the input values manually.
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.
updated
If there is new command added, please add test for the command. |
@@ -106,6 +106,8 @@ def _check_tanzu_components_not_enable(cmd, namespace): | |||
raise ArgumentUsageError('--enable-application-live-view {}'.format(suffix)) | |||
if namespace.enable_application_accelerator: | |||
raise ArgumentUsageError('--enable-application-accelerator {}'.format(suffix)) | |||
if namespace.application_configuration_service_generation: | |||
raise ArgumentUsageError('--application_configuration_service_generation {}'.format(suffix)) |
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.
raise ArgumentUsageError('--application_configuration_service_generation {}'.format(suffix)) | |
raise ArgumentUsageError('--application-configuration-service-generation {}'.format(suffix)) |
Do you want to release a new extension version? If so, please add the version to setup.py. |
src/spring/azext_spring/_params.py
Outdated
@@ -810,6 +817,10 @@ def prepare_logs_argument(c): | |||
with self.argument_context('spring application-configuration-service {}'.format(scope)) as c: | |||
c.argument('app', app_name_type, help='Name of app.', validator=validate_app_name) | |||
|
|||
for scope in ['create', 'update']: | |||
with self.argument_context('spring application-configuration-service {}'.format(scope)) as c: | |||
c.argument('generation', arg_type=get_enum_type(ConfigurationServiceGeneration), help='Generation.') |
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.
help='Generation.'
Could you please provide the more specific and understandable help message?
Co-authored-by: Xing Zhou <[email protected]>
Co-authored-by: Xing Zhou <[email protected]>
[Release] Update index.json for extension [ spring ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=65801&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
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.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
.