Skip to content

Commit 3f15654

Browse files
authored
[Container app] az containerapp sessionpool create: Fix default container name to be lower case letters (Azure#7635)
1 parent 1a5e677 commit 3f15654

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/containerapp/HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release History
55
upcoming
66
++++++
77
* 'az containerapp create/update': Update default value of enableMetrics to True for java runtime setting
8+
* 'az containerapp sessionpool create': Fix default container name to be lower case letters
89

910
0.3.51
1011
++++++

src/containerapp/azext_containerapp/_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def load_arguments(self, _):
380380
with self.argument_context('containerapp sessionpool', arg_group='Container') as c:
381381
c.argument('managed_env', validator=validate_managed_env_name_or_id, options_list=['--environment'], help="Name or resource ID of the container app's environment.")
382382
c.argument('image', options_list=['--image', '-i'], help="Container image, e.g. publisher/image-name:tag.")
383-
c.argument('container_name', help="Name of the container.")
383+
c.argument('container_name', help="Name of the container. On create if no container name is provided the container name will default to the name of the session pool coverted to lower case.")
384384
c.argument('cpu', type=float, validator=validate_cpu, help="Required CPU in cores from 0.25 - 2.0, e.g. 0.5")
385385
c.argument('memory', validator=validate_memory, help="Required memory from 0.5 - 4.0 ending with \"Gi\", e.g. 1.0Gi")
386386
c.argument('env_vars', nargs='*', help="A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret.")

src/containerapp/azext_containerapp/containerapp_sessionpool_decorator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def set_up_resource(self):
218218

219219
def set_up_container(self):
220220
container_def = ContainerModel
221-
container_def["name"] = self.get_argument_container_name() if self.get_argument_container_name() else self.get_argument_name()
221+
container_def["name"] = self.get_argument_container_name() if self.get_argument_container_name() else self.get_argument_name().lower()
222222
container_def["image"] = self.get_argument_image() if self.get_argument_image() else HELLO_WORLD_IMAGE
223223
if self.get_argument_env_vars() is not None:
224224
container_def["env"] = parse_env_var_flags(self.get_argument_env_vars())

0 commit comments

Comments
 (0)