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

fix: azuredisk parameter lowercase translation issue #107429

Merged

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Jan 9, 2022

What type of PR is this?

/kind bug
/priority important-soon
/sig cloud-provider
/area provider/azure
/triage accepted

What this PR does / why we need it:

fix: azuredisk parameter lowercase translation issue

parameter cachingmode: None (cachingMode does) is not recognized in csi migration, this PR fixes the issue.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: azuredisk parameter lowercase translation issue

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

fix: azuredisk parameter lowercase translation issue

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/provider/azure Issues or PRs related to azure provider triage/accepted Indicates an issue or PR is ready to be actively worked on. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 9, 2022
@andyzhangx
Copy link
Member Author

/retest

@ialidzhikov
Copy link
Contributor

/assign @msau42

azureDiskCachingMode: "cachingmode",
azureDiskFSType: fsType,
azureDiskKind: "managed",
"cachingmode": "ReadOnly",
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 add a test case using the camelcase field names? It looks like the older version of the driver accepted camelcased fields: https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/release-1.0/pkg/azuredisk/controllerserver.go#L907

Also, on a related note, it looks like the latest version of the driver no longer accepts camelcase fields. That appears to be a backwards incompatible change that you probably want to fix. https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/pkg/azureutils/azure_disk_utils.go#L126:6

Copy link
Member Author

Choose a reason for hiding this comment

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

@msau42 thanks for review. in line 369, there are camelcase test cases:

							VolumeAttributes: map[string]string{
								"cachingMode": "None",
								"fsType":      fsType,
								azureDiskKind: "managed",
							},

And csi driver still supports camel case, it's now using strings.EqualFold(k, consts.CachingModeField) (just another way):
https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/pkg/azureutils/azure_disk_utils.go#L133

Copy link
Member

Choose a reason for hiding this comment

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

thanks!

@msau42
Copy link
Member

msau42 commented Jan 13, 2022

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 13, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, msau42

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 2f64227 into kubernetes:master Jan 13, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Jan 13, 2022
k8s-ci-robot added a commit that referenced this pull request Jan 14, 2022
…107429-upstream-release-1.23

Automated cherry pick of #107429: fix: azuredisk parameter lowercase translation issue
k8s-ci-robot added a commit that referenced this pull request Jan 14, 2022
…107429-upstream-release-1.22

Automated cherry pick of #107429: fix: azuredisk parameter lowercase translation issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants