Skip to content

Commit 2b87b6c

Browse files
authored
[Containerapp] Fix #32107: az containerapp registry show: Fix NoneType error when container app doesn't have any registry server (#32270)
1 parent e40d423 commit 2b87b6c

3 files changed

Lines changed: 2401 additions & 1864 deletions

File tree

src/azure-cli/azure/cli/command_modules/containerapp/custom.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,9 +2895,10 @@ def show_registry(cmd, name, resource_group_name, server):
28952895

28962896
registries_def = containerapp_def["properties"]["configuration"]["registries"]
28972897

2898-
for r in registries_def:
2899-
if r['server'].lower() == server.lower():
2900-
return r
2898+
if registries_def is not None:
2899+
for r in registries_def:
2900+
if r['server'].lower() == server.lower():
2901+
return r
29012902
raise InvalidArgumentValueError("The containerapp {} does not have specified registry assigned.".format(name))
29022903

29032904

0 commit comments

Comments
 (0)