Skip to content

Commit

Permalink
TCP support. (Azure#156)
Browse files Browse the repository at this point in the history
* Finished feature.

* Fixed comments.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>
  • Loading branch information
runefa and Haroon Feisal authored Sep 23, 2022
1 parent f47f244 commit 8efcac5
Show file tree
Hide file tree
Showing 5 changed files with 8,371 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Release History
++++++
* Add 'az containerapp env update' to update managed environment properties
* Add custom domains support to 'az containerapp env create' and 'az containerapp env update'
* Add tcp support for ingress transport and scale rules

0.3.11
++++++
Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def load_arguments(self, _):
c.argument('max_replicas', type=int, help="The maximum number of replicas.")
c.argument('scale_rule_name', options_list=['--scale-rule-name', '--srn'], help="The name of the scale rule.")
c.argument('scale_rule_type', options_list=['--scale-rule-type', '--srt'], help="The type of the scale rule. Default: http.")
c.argument('scale_rule_http_concurrency', type=int, options_list=['--scale-rule-http-concurrency', '--srhc'], help="The maximum number of concurrent http requests before scale out. Only supported for http scale rules.")
c.argument('scale_rule_http_concurrency', type=int, options_list=['--scale-rule-http-concurrency', '--src', '--scale-rule-tcp-concurrency'], help="The maximum number of concurrent requests before scale out. Only supported for http and tcp scale rules.")
c.argument('scale_rule_metadata', nargs="+", options_list=['--scale-rule-metadata', '--srm'], help="Scale rule metadata. Metadata must be in format \"<key>=<value> <key>=<value> ...\".")
c.argument('scale_rule_auth', nargs="+", options_list=['--scale-rule-auth', '--sra'], help="Scale rule auth parameters. Auth parameters must be in format \"<triggerParameter>=<secretRef> <triggerParameter>=<secretRef> ...\".")

Expand Down
4 changes: 2 additions & 2 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def create_containerapp(cmd,
scale_rule_def = ScaleRuleModel
curr_metadata = {}
if scale_rule_http_concurrency:
if scale_rule_type == "http":
if scale_rule_type in ('http', 'tcp'):
curr_metadata["concurrentRequests"] = str(scale_rule_http_concurrency)
metadata_def = parse_metadata_flags(scale_rule_metadata, curr_metadata)
auth_def = parse_auth_flags(scale_rule_auth)
Expand Down Expand Up @@ -789,7 +789,7 @@ def update_containerapp_logic(cmd,
scale_rule_def = ScaleRuleModel
curr_metadata = {}
if scale_rule_http_concurrency:
if scale_rule_type == "http":
if scale_rule_type in ('http', 'tcp'):
curr_metadata["concurrentRequests"] = str(scale_rule_http_concurrency)
metadata_def = parse_metadata_flags(scale_rule_metadata, curr_metadata)
auth_def = parse_auth_flags(scale_rule_auth)
Expand Down
Loading

0 comments on commit 8efcac5

Please sign in to comment.