Skip to content

Commit

Permalink
fix: avoid clearing the autoscaler profile when its not specified (Az…
Browse files Browse the repository at this point in the history
  • Loading branch information
marwanad authored Apr 13, 2020
1 parent 9a809eb commit d56c776
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,9 +1173,11 @@ def aks_update(cmd, # pylint: disable=too-many-statements,too-many-branches,
instance.agent_pool_profiles[0].min_count = None
instance.agent_pool_profiles[0].max_count = None

if not cluster_autoscaler_profile:
# if intention is to clear profile
if cluster_autoscaler_profile == {}:
instance.auto_scaler_profile = {}
else:
# else profile is provided, update instance profile if it exists
elif cluster_autoscaler_profile:
instance.auto_scaler_profile = _update_dict(instance.auto_scaler_profile.__dict__,
dict((key.replace("-", "_"), value)
for (key, value) in cluster_autoscaler_profile.items())) \
Expand Down

0 comments on commit d56c776

Please sign in to comment.