-
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
Add end to end logics for ACS, Service Registry, Gateway and API portal #4282
Conversation
spring cloud |
c.argument('host_key', help='Host key of the added config.') | ||
c.argument('host_key_algorithm', help='Host key algorithm of the added config.') | ||
c.argument('private_key', help='Private_key of the added config.') | ||
c.argument('host_key_check', help='Strict_host_key_checking of the added config.') |
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 you please explain Strict_host_key_checking
more specifically?
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.
Added explanation
|
||
def validate_routes(namespace): | ||
if namespace.routes_json is not None and namespace.routes_file is not None: | ||
raise ValidationError("You can only specify either --routes-json or --routes-file.") |
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 the more specific error type MutuallyExclusiveArgumentError
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 all error types
def validate_gateway_instance_count(namespace): | ||
if namespace.gateway_instance_count is not None: | ||
if namespace.gateway_instance_count < 1: | ||
raise ValidationError("--gateway-instance-count must be greater than 0") |
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 the more specific error type InvalidArgumentValueError
def validate_api_portal_instance_count(namespace): | ||
if namespace.api_portal_instance_count is not None: | ||
if namespace.api_portal_instance_count < 1: | ||
raise ValidationError("--api-portal-instance-count must be greater than 0") |
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 the more specific error type InvalidArgumentValueError
all_provided = namespace.scope and namespace.client_id and namespace.client_secret and namespace.issuer_uri | ||
none_provided = namespace.scope is None and namespace.client_id is None and namespace.client_secret is None and namespace.issuer_uri is None | ||
if not all_provided and not none_provided: | ||
raise ValidationError("Single Sign On configurations '--scope --client-id --client-secret --issuer-uri' should be all provided or none provided.") |
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 the more specific error type ArgumentUsageError
def validate_git_uri(namespace): | ||
uri = namespace.uri | ||
if uri and (not uri.startswith("https://")) and (not uri.startswith("git@")): | ||
raise ValidationError("Git URI should start with \"https://\" or \"git@\"") |
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 the more specific error type InvalidArgumentValueError
invalid_list = [p for p in pattern_list if not _is_valid_pattern(p)] | ||
if len(invalid_list) > 0: | ||
logger.warning("Patterns '%s' are invalid.", ','.join(invalid_list)) | ||
raise ValidationError("Patterns should be the collection of patterns separated by comma, each pattern in the format of 'application' or 'application/profile'") |
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 the more specific error type InvalidArgumentValueError
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
for scope in ['spring-cloud gateway custom-domain', | ||
'spring-cloud api-portal custom-domain']: | ||
with self.argument_context(scope) as c: | ||
c.argument('domain_name', help='Name of custom domain.') | ||
|
||
for scope in ['spring-cloud gateway custom-domain bind', | ||
'spring-cloud gateway custom-domain update', | ||
'spring-cloud api-portal custom-domain bind', | ||
'spring-cloud api-portal custom-domain update']: | ||
with self.argument_context(scope) as c: | ||
c.argument('certificate', type=str, help='Certificate name in Azure Spring Cloud.') |
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
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
c.argument('host_key', help='Host key of the added config.') | ||
c.argument('host_key_algorithm', help='Host key algorithm of the added config.') | ||
c.argument('private_key', help='Private_key of the added config.') | ||
c.argument('host_key_check', help='Strict_host_key_checking of the added config. If false, ignore errors with host key.') |
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 you replace Strict_host_key_checking
with a more understandable description
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, the concept is used in SSH authentication of Configuration Service.
The pr is part of main...VSChina:enterprise.
Add end to end logics for 4 Tanzu components: ACS, Service Registry, Gateway and API portal. Including commands, params, help, transformers and validator.
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 PR is merged into master branch, a new PR will be created to update
src/index.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.