Skip to content
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

containerapp add three type for enable workload profiles #6647

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release History
upcoming
++++++
* Removed preview tag for some command groups and params (e.g. 'az containerapp job', 'az containerapp env storage', 'az containerapp env workload-profile')
* 'az containerapp env': --enable-workload-profiles allowed values:true, false

0.3.37
++++++
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 @@ -192,7 +192,7 @@ def load_arguments(self, _):

with self.argument_context('containerapp env create') as c:
c.argument('zone_redundant', options_list=["--zone-redundant", "-z"], help="Enable zone redundancy on the environment. Cannot be used without --infrastructure-subnet-resource-id. If used with --location, the subnet's location must match")
c.argument('enable_workload_profiles', action='store_true', options_list=["--enable-workload-profiles", "-w"], help="Allow this environment to have workload profiles", is_preview=True)
c.argument('enable_workload_profiles', arg_type=get_three_state_flag(), options_list=["--enable-workload-profiles", "-w"], help="Boolean indicating if the environment enabled to have workload profiles", is_preview=True)
Greedygre marked this conversation as resolved.
Show resolved Hide resolved

with self.argument_context('containerapp env update') as c:
c.argument('name', name_type, help='Name of the Container Apps environment.')
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,27 @@ def test_containerapp_env_workload_profiles_delete(self, resource_group):
profiles = self.cmd("az containerapp env workload-profile list -g {} -n {}".format(resource_group, env)).get_output_in_json()
self.assertEqual(len(profiles), 1)

@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus")
def test_containerapp_create_enable_workload_profiles_three_state_flag(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
env = self.create_random_name(prefix='env', length=24)
self.cmd('containerapp env create -g {} -n {} --logs-destination none --enable-workload-profiles false'.format(resource_group, env), expect_failure=False, checks=[
JMESPathCheck("name", env),
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("properties.workloadProfiles", None),
])
env2 = self.create_random_name(prefix='env2', length=24)
self.cmd('containerapp env create -g {} -n {} --logs-destination none --enable-workload-profiles true'.format(
Greedygre marked this conversation as resolved.
Show resolved Hide resolved
resource_group, env2), expect_failure=False, checks=[
JMESPathCheck("name", env2),
JMESPathCheck("properties.provisioningState", "Succeeded"),
JMESPathCheck("length(properties.workloadProfiles)", 1),
JMESPathCheck('properties.workloadProfiles[0].name', "Consumption", case_sensitive=False),
JMESPathCheck('properties.workloadProfiles[0].workloadProfileType', "Consumption", case_sensitive=False),
])


@AllowLargeResponse(8192)
@ResourceGroupPreparer(location="eastus")
def test_containerapp_create_with_workloadprofile_yaml(self, resource_group):
Expand Down