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
Automated cherry pick of #108000: azure_file: add namespace tests for InTree to CSI #108601
Automated cherry pick of #108000: azure_file: add namespace tests for InTree to CSI #108601
Conversation
When translating InTree pv to CSI pv we use default secret namespace when it's not found in the InTree pv. Using the default is not ideal for several reasons: 1) it can result in failed pod creation after users migrate to cluster with CSI enabled because the existing intree pvs might not have the namespace defined. In that case the "default" is used and mount fails because secret could not be found. 2) falling back to "default" namespace can result in referencing a secret from different namespace which is a security risk However, there is another object we can use to determine correct namespace which presence can be safely assumed - ClaimRef. Mounting a volume is done only through a PVC which is bound. Binding adds ClaimRef to PV and finally the volume gets mounted which is where the translation code is used.
This is the actual fix - attempt to obtain a namespace from ClaimRef. Or fail if namespace could not be found instead of using "default".
/priority important-soon |
/lgtm |
/approve |
/retest |
/kind bug |
/test pull-kubernetes-e2e-capz-azure-file |
/retest |
1 similar comment
/retest |
@cpanato could you approve? thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, cpanato, 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 |
/retest |
Cherry pick of #108000 on release-1.22.
#108000: azure_file: add namespace tests for InTree to CSI
For details on the cherry pick process, see the cherry pick requests page.