Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix location & add more test cases
  • Loading branch information
lil131 committed May 20, 2022
commit 8f3176003fb8ba777503af7b8671325ca05518c2
1 change: 1 addition & 0 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def load_arguments(self, _):

with self.argument_context('containerapp hostname list') as c:
c.argument('name', id_part=None)
c.argument('location', configured_default='location')

with self.argument_context('containerapp hostname delete') as c:
c.argument('hostname', help='The custom domain name.')
6 changes: 4 additions & 2 deletions src/containerapp/azext_containerapp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,10 @@ def patch_new_custom_domain(cmd, resource_group_name, name, new_custom_domains):
def get_custom_domains(cmd, resource_group_name, name, location=None, environment=None):
try:
app = ContainerAppClient.show(cmd=cmd, resource_group_name=resource_group_name, name=name)
if location and (app["location"] != location):
raise ResourceNotFoundError('Container app {} is not in location {}.'.format(name, location))
if location:
_ensure_location_allowed(cmd, location, "Microsoft.App", "containerApps")
if _normalize_location(cmd, app["location"]) != _normalize_location(cmd, location):
raise ResourceNotFoundError('Container app {} is not in location {}.'.format(name, location))
if environment and (_get_name(environment) != _get_name(app["properties"]["managedEnvironmentId"])):
raise ResourceNotFoundError('Container app {} is not under environment {}.'.format(name, environment))
if "ingress" in app["properties"]["configuration"] and "customDomains" in app["properties"]["configuration"]["ingress"]:
Expand Down
Loading