-
Notifications
You must be signed in to change notification settings - Fork 1.6k
support acs gen2 #6402
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
Changes from 4 commits
9f9e4d8
3cb3c4f
fc3ae4c
1f6244d
23de20a
108699d
f34e553
c3332fb
4839f41
52a5fe2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,7 @@ | |||||||||||||||||||||||||||||
| validate_acs_ssh_or_warn, validate_apm_properties, validate_apm_secrets, | ||||||||||||||||||||||||||||||
| validate_apm_not_exist, validate_apm_update, validate_apm_reference, | ||||||||||||||||||||||||||||||
| validate_apm_reference_and_enterprise_tier, validate_cert_reference, | ||||||||||||||||||||||||||||||
| validate_build_cert_reference) | ||||||||||||||||||||||||||||||
| validate_build_cert_reference, validate_acs_create) | ||||||||||||||||||||||||||||||
| from ._app_validator import (fulfill_deployment_param, active_deployment_exist, | ||||||||||||||||||||||||||||||
| ensure_not_active_deployment, validate_deloy_path, validate_deloyment_create_path, | ||||||||||||||||||||||||||||||
| validate_cpu, validate_build_cpu, validate_memory, validate_build_memory, | ||||||||||||||||||||||||||||||
|
|
@@ -41,7 +41,7 @@ | |||||||||||||||||||||||||||||
| validate_app_force_set_system_identity_or_warning, | ||||||||||||||||||||||||||||||
| validate_app_force_set_user_identity_or_warning) | ||||||||||||||||||||||||||||||
| from ._utils import ApiType | ||||||||||||||||||||||||||||||
| from .vendored_sdks.appplatform.v2023_05_01_preview.models._app_platform_management_client_enums import (SupportedRuntimeValue, TestKeyType, BackendProtocol, SessionAffinity, ApmType, BindingType) | ||||||||||||||||||||||||||||||
| from .vendored_sdks.appplatform.v2023_05_01_preview.models._app_platform_management_client_enums import (ConfigurationServiceGeneration, SupportedRuntimeValue, TestKeyType, BackendProtocol, SessionAffinity, ApmType, BindingType) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| name_type = CLIArgumentType(options_list=[ | ||||||||||||||||||||||||||||||
|
|
@@ -156,7 +156,14 @@ def load_arguments(self, _): | |||||||||||||||||||||||||||||
| c.argument('enable_application_configuration_service', | ||||||||||||||||||||||||||||||
| action='store_true', | ||||||||||||||||||||||||||||||
| options_list=['--enable-application-configuration-service', '--enable-acs'], | ||||||||||||||||||||||||||||||
| arg_group="Application Configuration Service", | ||||||||||||||||||||||||||||||
| help='(Enterprise Tier Only) Enable Application Configuration Service.') | ||||||||||||||||||||||||||||||
| 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', | ||||||||||||||||||||||||||||||
|
Comment on lines
+161
to
167
Contributor
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. If this parameter has limited values, please add
Suggested change
Contributor
Author
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. Thanks! updated |
||||||||||||||||||||||||||||||
| action='store_true', | ||||||||||||||||||||||||||||||
| options_list=['--enable-application-live-view', '--enable-alv'], | ||||||||||||||||||||||||||||||
|
|
@@ -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))) | ||||||||||||||||||||||||||||||
|
Contributor
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. Same as above
Contributor
Author
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. updated |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| for scope in ['add', 'update']: | ||||||||||||||||||||||||||||||
| with self.argument_context('spring application-configuration-service git repo {}'.format(scope)) as c: | ||||||||||||||||||||||||||||||
| c.argument('patterns', | ||||||||||||||||||||||||||||||
|
|
@@ -826,6 +837,7 @@ def prepare_logs_argument(c): | |||||||||||||||||||||||||||||
| c.argument('host_key_algorithm', help='Host key algorithm of the added config.') | ||||||||||||||||||||||||||||||
| c.argument('private_key', help='Private_key of the added config.', validator=validate_acs_ssh_or_warn) | ||||||||||||||||||||||||||||||
| c.argument('host_key_check', help='Strict host key checking of the added config which is used in SSH authentication. If false, ignore errors with host key.') | ||||||||||||||||||||||||||||||
| c.argument('ca_cert_name', help='CA certificate name.') | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| for scope in ['add', 'update', 'remove']: | ||||||||||||||||||||||||||||||
| with self.argument_context('spring application-configuration-service git repo {}'.format(scope)) as c: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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)) | ||||||
|
Contributor
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.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| def validate_instance_count(namespace): | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |||||
| from azure.core.exceptions import ResourceNotFoundError | ||||||
| from knack.log import get_logger | ||||||
| from .vendored_sdks.appplatform.v2023_05_01_preview.models import (ApmReference, CertificateReference) | ||||||
| from .vendored_sdks.appplatform.v2023_05_01_preview.models._app_platform_management_client_enums import ApmType | ||||||
| from .vendored_sdks.appplatform.v2023_05_01_preview.models._app_platform_management_client_enums import (ApmType, ConfigurationServiceGeneration) | ||||||
|
|
||||||
| from ._resource_quantity import validate_cpu as validate_and_normalize_cpu | ||||||
| from ._resource_quantity import \ | ||||||
|
|
@@ -345,6 +345,23 @@ def _is_valid_app_and_profile_name(pattern): | |||||
| return len(parts) == 2 and _is_valid_app_name(parts[0]) and _is_valid_profile_name(parts[1]) | ||||||
|
|
||||||
|
|
||||||
| 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.") | ||||||
|
Contributor
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.
Suggested change
Contributor
Author
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. fixed |
||||||
|
|
||||||
|
|
||||||
| def validate_acs_create_or_update(namespace): | ||||||
| _validate_acs_generation(namespace) | ||||||
|
|
||||||
|
|
||||||
| def _validate_acs_generation(namespace): | ||||||
| if namespace.generation is None: | ||||||
| return | ||||||
| if (namespace.generation not in list(ConfigurationServiceGeneration)): | ||||||
| raise InvalidArgumentValueError("Allowed generation are: " + ', '.join(list(ConfigurationServiceGeneration))) | ||||||
|
Contributor
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. After adding
Contributor
Author
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. updated |
||||||
|
|
||||||
|
|
||||||
| def validate_gateway_update(namespace): | ||||||
| _validate_sso(namespace) | ||||||
| validate_cpu(namespace) | ||||||
|
|
||||||
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.
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