forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[containerapp]
az containerapp create/update
: Support --customized-…
…keys and clientType in --bind for dev service (Azure#6939) * add test and add clientType and customized keys * fix test * fix * fix test * add test for yaml * fix * add more tests * fix conflict * fix customizedKey for yaml * address comments * add more comments * add test cases * fix test * Update src/containerapp/azext_containerapp/_params.py Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com> * Update src/containerapp/azext_containerapp/_params.py Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com> --------- Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
- Loading branch information
1 parent
6eb01fb
commit 7fc0f72
Showing
11 changed files
with
15,605 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
import argparse | ||
from collections import defaultdict | ||
from azure.cli.core.azclierror import ValidationError | ||
|
||
|
||
class AddCustomizedKeys(argparse.Action): | ||
def __call__(self, parser, namespace, values, option_string=None): | ||
action = self.get_action(values, option_string) | ||
namespace.customized_keys = action | ||
|
||
def get_action(self, values, option_string): # pylint: disable=no-self-use | ||
try: | ||
properties = defaultdict(list) | ||
for (k, v) in (x.split('=', 1) for x in values): | ||
properties[k] = v | ||
properties = dict(properties) | ||
return properties | ||
except ValueError: | ||
raise ValidationError('Usage error: {} [DesiredKey=DefaultKey ...]'.format(option_string)) |
Oops, something went wrong.