Skip to content

Commit

Permalink
Merge pull request Azure#131 from StrawnSC/fix_registry_userpass_stil…
Browse files Browse the repository at this point in the history
…l_set

`az containerapp registry set`: remove username/password if setting identity and vice versa
  • Loading branch information
StrawnSC authored Jun 13, 2022
2 parents fbd572e + 2f2176e commit d57bbba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release History
0.3.7
++++++
* 'az containerapp env create': fixed bug where "--internal-only" didn't work
* 'az containerapp registry set': remove username/password if setting identity and vice versa

0.3.6
++++++
Expand Down
4 changes: 4 additions & 0 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1729,15 +1729,19 @@ def set_registry(cmd, name, resource_group_name, server, username=None, password
updating_existing_registry = True
if username:
r["username"] = username
r["identity"] = None
if password:
r["passwordSecretRef"] = store_as_secret_and_return_secret_ref(
containerapp_def["properties"]["configuration"]["secrets"],
r["username"],
r["server"],
password,
update_existing_secret=True)
r["identity"] = None
if identity:
r["identity"] = identity
r["username"] = None
r["passwordSecretRef"] = None

# If not updating existing registry, add as new registry
if not updating_existing_registry:
Expand Down

0 comments on commit d57bbba

Please sign in to comment.