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

topology translation of in-tree vSphere volume to vSphere CSI #108611

Conversation

divyenpatel
Copy link
Member

@divyenpatel divyenpatel commented Mar 9, 2022

What type of PR is this?

/kind bug

Optionally add one or more of the following kinds if applicable:
/kind regression

What this PR does / why we need it:

vSphere CSI driver does not understand legacy topology labels in-tree vSphere plugin is using.
This PR is adding topology translation from in-tree vSphere volume to vSphere CSI.

This PR is translating topology GA/topology beta labels to topology.csi.vmware.com/region and topology.csi.vmware.com/zone.

Special notes for your reviewer:

Pre-req for topology translation support.
vSphere CSI Driver must be installed using following vSphere Config Secret

[Labels]
region = k8s-region
zone = k8s-zone
[TopologyCategory "k8s-region"]
Label = "topology.csi.vmware.com/region"
[TopologyCategory "k8s-zone"]
Label = "topology.csi.vmware.com/zone"

Unit test execution

% go test -v -run  TestTranslatevSphereInTreeStorageClassToCSI
=== RUN   TestTranslatevSphereInTreeStorageClassToCSI
    vsphere_volume_test.go:113: Testing expect error when sc is nil
    vsphere_volume_test.go:113: Testing translate with no parameter
    vsphere_volume_test.go:113: Testing translate with unknown parameter
    vsphere_volume_test.go:113: Testing translate with storagepolicyname and datastore
    vsphere_volume_test.go:113: Testing translate with fstype
    vsphere_volume_test.go:113: Testing translate with storagepolicyname and fstype
    vsphere_volume_test.go:113: Testing translate with no parameter and allowedTopology
    vsphere_volume_test.go:113: Testing translate with storagepolicyname and allowedTopology
    vsphere_volume_test.go:113: Testing translate with storagepolicyname and allowedTopology beta labels
    vsphere_volume_test.go:113: Testing translate with raw vSAN policy parameters, datastore and diskformat
    vsphere_volume_test.go:113: Testing translate with all parameters
--- PASS: TestTranslatevSphereInTreeStorageClassToCSI (0.00s)
PASS
ok      k8s.io/csi-translation-lib/plugins      0.381s
 % go test -v -run  TestTranslateVSphereInTreePVToCSI
=== RUN   TestTranslateVSphereInTreePVToCSI
    vsphere_volume_test.go:464: Testing expect error when in-tree vsphere PV is nil
    vsphere_volume_test.go:464: Testing translate valid vSphere in-tree PV to vSphere CSI PV
    vsphere_volume_test.go:464: Testing translate valid vSphere in-tree PV with beta topology labels to vSphere CSI PV
    vsphere_volume_test.go:464: Testing translate valid vSphere in-tree PV with GA topology labels to vSphere CSI PV
--- PASS: TestTranslateVSphereInTreePVToCSI (0.00s)
PASS
ok      k8s.io/csi-translation-lib/plugins      0.178s
% go test -v -run  TestTranslateVSphereCSIPVToInTree
=== RUN   TestTranslateVSphereCSIPVToInTree
    vsphere_volume_test.go:276: Testing expect error when pv is nil
    vsphere_volume_test.go:276: Testing expect error when pv.Spec.CSI is nil
    vsphere_volume_test.go:276: Testing translate valid vSphere CSI PV to vSphere in-tree PV
    vsphere_volume_test.go:276: Testing translate valid vSphere CSI PV with topology Node Affinity rules to vSphere CSI PV with topology labels
--- PASS: TestTranslateVSphereCSIPVToInTree (0.00s)
PASS
ok      k8s.io/csi-translation-lib/plugins      0.365s

Does this PR introduce a user-facing change?

topology translation of in-tree vSphere volume to vSphere CSI.

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 9, 2022
@k8s-ci-robot
Copy link
Contributor

@divyenpatel: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 9, 2022
@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 9, 2022
@divyenpatel
Copy link
Member Author

@shalini-b I have addressed your review comments here - 7aa4379

@shalini-b
Copy link

/approve

@divyenpatel divyenpatel force-pushed the add-csi-topology-translation-for-in-tree-vSphere-volumes branch from 7aa4379 to bd7f083 Compare March 11, 2022 18:30
@xing-yang
Copy link
Contributor

/lgtm

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

/assign @msau42 @Jiawei0227

@xing-yang
Copy link
Contributor

/assign @gnufied

@msau42
Copy link
Member

msau42 commented Mar 17, 2022

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel, msau42, shalini-b

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 Mar 17, 2022
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants