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

tags key is assumed to be case-sensitive #658

Closed
feiskyer opened this issue Jun 16, 2021 · 3 comments · Fixed by #669
Closed

tags key is assumed to be case-sensitive #658

feiskyer opened this issue Jun 16, 2021 · 3 comments · Fixed by #669
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@feiskyer
Copy link
Member

feiskyer commented Jun 16, 2021

What happened:

According to Azure docs, A tag name can have a maximum of 512 characters and is case-insensitive. But the codes below are actually case-sensitive for tags key:

// if the systemTags is not set, just add/update new currentTagsOnResource and not delete old currentTagsOnResource
for k, v := range newTags {
if vv, ok := currentTagsOnResource[k]; !ok || !strings.EqualFold(to.String(v), to.String(vv)) {
currentTagsOnResource[k] = v
changed = true
}
}
// if the systemTags is set, delete the old currentTagsOnResource
if len(systemTagsMap) > 0 {
for k := range currentTagsOnResource {
if _, ok := newTags[k]; !ok && !systemTagsMap.Has(k) {
delete(currentTagsOnResource, k)
changed = true
}
}
}

What you expected to happen:

tags name should be case-insensitive. and if the tags have already been there, then existing tag name should be used.

How to reproduce it:

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): >=1.20
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@feiskyer
Copy link
Member Author

/assign @nilo19

Still need cherry-picking to kubernetes repo

@feiskyer feiskyer added the kind/bug Categorizes issue or PR as related to a bug. label Aug 25, 2021
@feiskyer
Copy link
Member Author

feiskyer commented Sep 2, 2021

Refer kubernetes/kubernetes#104705

@feiskyer
Copy link
Member Author

cherry-pick PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants