Skip to content

Conversation

@kaiqzhan
Copy link
Contributor

@kaiqzhan kaiqzhan commented Oct 1, 2020

Description

AKS server treats addon names and addon config keys as case insensitive, and store them in DB as it is in input. For example, we have both logAnalyticsWorkspaceResourceID and loganalyticsworkspaceresourceid in our DB and both are valid. However, in the public document we're only giving examples of logAnalyticsWorkspaceResourceID.
This change makes Azure CLI always convert the keys to the name defined in Azure CLI. (The name defined in Azure CLI is the same as public document), so that customer get the right name back.

Testing Guide

  1. Create a AKS cluster.
  2. Run az aks enable-addons -a kube-dashboard -g testrg -n testcluster
  3. The name of kube-dashboard addon name should be change from "KubeDashboard" to "kubeDashboard"

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

@kaiqzhan kaiqzhan requested a review from arrownj as a code owner October 1, 2020 02:34
@kaiqzhan
Copy link
Contributor Author

kaiqzhan commented Oct 1, 2020

@robbiezhang

@yungezz yungezz added the AKS az aks/acs/openshift label Oct 1, 2020
Copy link
Member

@yungezz yungezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you pls add test to cover this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for != part, better to lower() before compare

Copy link
Contributor Author

@kaiqzhan kaiqzhan Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here my intention is to change the keys back to 'logAnalyticsWorkspaceResourceID'. The intention of key != 'logAnalyticsWorkspaceResourceID' is to skip if the key is already be 'logAnalyticsWorkspaceResourceID'.
For example, if the key is 'loganalyticsworkspaceresourceid' or 'LogAnalyticsWorkspaceResourceID', the value will be pop out and write back with key 'logAnalyticsWorkspaceResourceID'. But if the key is already 'logAnalyticsWorkspaceResourceID', it skips and nothing changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you assign 'logAnalyticsWorkspaceResourceID' to a variable and use the variable instead of using the hard-coded string in multiple places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fengzhou-msft We're already doing that pattern in azure-cli-extension. I'll change that in another pr.

@Azure Azure deleted a comment from yonzhan Oct 1, 2020
@yungezz
Copy link
Member

yungezz commented Oct 9, 2020

hi @kaiqizhang would you pls address comments? today is Code complete date, would you like to catch this release?

@yungezz yungezz closed this Oct 9, 2020
@yungezz yungezz reopened this Oct 9, 2020
@kaiqzhan
Copy link
Contributor Author

kaiqzhan commented Oct 9, 2020

hi @kaiqizhang would you pls address comments? today is Code complete date, would you like to catch this release?

Oh, sorry for late. Will do it soon.

@yungezz
Copy link
Member

yungezz commented Oct 9, 2020

hi @kaiqizhang just want to double confirm, this change will not cause existing users' breaking change right? little concern because it changed existing output

@yungezz yungezz merged commit f720703 into Azure:dev Oct 9, 2020
@kaiqzhan
Copy link
Contributor Author

kaiqzhan commented Oct 9, 2020

hi @kaiqizhang just want to double confirm, this change will not cause existing users' breaking change right? little concern because it changed existing output

It's a long story. 2 months ago, we did a breaking change on the server side. All the keys are converted to lower cases. Based on the IcM at that time and discussion in the team, we reverted the change. Some customer cares about the case because they're using json query in their script. With this change in Azure CLI, customers can change the case back if it's necessary for them. (customer can still use different case in Terraform, Postman, etc.)
Back to this question, it's possible that customer see different addon key if disable, re-enable a specific addon. But it aligns to our public document. I suggest we can mention this change in the change log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS az aks/acs/openshift

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants