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 flaws in Azure CSI translation #90162

Merged
merged 2 commits into from Apr 21, 2020

Conversation

rfranzke
Copy link
Contributor

@rfranzke rfranzke commented Apr 15, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
The Azure File CSI translation was not setting the DriverName field, eventually causing the attachdetach-controller to fail when CSI migration is enabled:

kubernetes.io/csi: attacher.Attach failed: VolumeAttachment.storage.k8s.io \"csi-19e8c8fd3545d41cebf6a51ffebcdd8588df8c5bfb9bd085b1689e7ca6704c59\" is invalid: [spec.attacher: Required value, spec.attacher: Invalid value: \"\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')]"

I implemented some unit tests for Azure along the way.

Does this PR introduce a user-facing change?:

Fix flaws in Azure File CSI translation

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Part of kubernetes/enhancements#1490

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 15, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @rfranzke. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 15, 2020
Copy link
Contributor

@ialidzhikov ialidzhikov left a comment

Choose a reason for hiding this comment

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

Nits

@rfranzke
Copy link
Contributor Author

/assign @andyzhangx @feiskyer @saad-ali
/sig storage
/area provider/azure
/priority important-soon

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. area/provider/azure Issues or PRs related to azure provider priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 15, 2020
@andyzhangx
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 15, 2020
@andyzhangx
Copy link
Member

@rfranzke thanks for your contribution!

@rfranzke
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

@k8s-ci-robot k8s-ci-robot added the area/dependency Issues or PRs related to dependency changes label Apr 15, 2020
@andyzhangx
Copy link
Member

/assign @msau42 @davidz627
could you approve? thanks.

@andyzhangx
Copy link
Member

/hold
hold a while for new commits on azure file csi migration issue

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 20, 2020
@andyzhangx
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 20, 2020
@andyzhangx
Copy link
Member

andyzhangx commented Apr 20, 2020

This PR would require following components change(adopt the PR) to make azure file csi migration works:

  • kube-controller-manager
  • kubelet
  • csi-provisioner
  • csi-attacher

And only works with azure file csi driver on master branch (with PR merged)

Copy link
Member

@msau42 msau42 left a comment

Choose a reason for hiding this comment

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

/approve

accountName, err := getStorageAccountName(azureSource.SecretName)
if err != nil {
klog.Warningf("getStorageAccountName(%s) returned with error: %v", azureSource.SecretName, err)
accountName = azureSource.SecretName
Copy link
Member

Choose a reason for hiding this comment

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

Is this a normal condition? Should it fail instead?

Copy link
Member

Choose a reason for hiding this comment

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

in such condition, secret is spedified by user, so it does not obey the naming rule, and this is only for volumeid generation, we will use NodeStageSecret for secret passing:

						NodeStageSecretRef: &v1.SecretReference{
							Name:      azureSource.SecretName,
							Namespace: defaultSecretNamespace,
						},

@msau42
Copy link
Member

msau42 commented Apr 21, 2020

And only works with azure file csi driver on master branch (with PR merged)

What happens if you run the new translation library against an older driver?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Apr 21, 2020
@andyzhangx
Copy link
Member

And only works with azure file csi driver on master branch (with PR merged)

What happens if you run the new translation library against an older driver?

there is a little refactor in azure file csi driver, let's only support new driver. Since it's still alpha, it's ok to be not backward compatible.

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 21, 2020
@rfranzke
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit f9532e4 into kubernetes:master Apr 21, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Apr 21, 2020
@rfranzke rfranzke deleted the fix/azure-csi-translation branch April 21, 2020 05:34
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 21, 2020
k8s-ci-robot added a commit that referenced this pull request May 9, 2020
…0162-upstream-release-1.17

Automated cherry pick of #90162: Fix flaws in Azure CSI translation
k8s-ci-robot added a commit that referenced this pull request May 9, 2020
…0162-upstream-release-1.18

Automated cherry pick of #90162: Fix flaws in Azure CSI translation
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/dependency Issues or PRs related to dependency changes area/provider/azure Issues or PRs related to azure provider area/release-eng Issues or PRs related to the Release Engineering subproject 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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/release Categorizes an issue or PR as relevant to SIG Release. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants