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] Fix 'NoneType object has no attribute get' error in az containerapp up with no ingress arguments #5646

Merged
merged 3 commits into from
Dec 26, 2022
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
4 changes: 4 additions & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
0.3.18
++++++
* Fix "'NoneType' object has no attribute 'get'" error in `az containerapp up` with no ingress arguments

0.3.17
++++++
* Fix polling logic for long running operations.
Expand Down
4 changes: 3 additions & 1 deletion src/containerapp/azext_containerapp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,9 @@ def safe_get(model, *keys, default=None):
if not model:
return default
for k in keys[:-1]:
model = model.get(k, {})
model = model.get(k)
if model is None:
return default
value = model.get(keys[-1], default)
return default if not value else value

Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ def set_registry(cmd, name, resource_group_name, server, username=None, password
registries_def = None
registry = None

if "registries" not in containerapp_def["properties"]["configuration"]:
if not containerapp_def["properties"]["configuration"].get("registries"):
StrawnSC marked this conversation as resolved.
Show resolved Hide resolved
containerapp_def["properties"]["configuration"]["registries"] = []

registries_def = containerapp_def["properties"]["configuration"]["registries"]
Expand Down
2 changes: 1 addition & 1 deletion src/containerapp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# TODO: Confirm this is the right version number you want and it matches your
# HISTORY.rst entry.

VERSION = '0.3.17'
VERSION = '0.3.18'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down