Skip to content

Conversation

@jmpfar
Copy link
Contributor

@jmpfar jmpfar commented Oct 15, 2020

What type of PR is this?
/kind feature

What this PR does / why we need it:

  1. Adding v1beta2 disk api group
  2. Adding SetAttachState, a function that allows changing the disk's online/offline status.
    This is needed because SanPolicy is not set to automount by default on all OSes.
    Consequently iSCSI disks will not be set online on connection.
  3. Adding GetAttachState, a function that queries a disk online/offline status
  4. Adding an integration test

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add GetAttachState/SetAttachState API that handle online/offline state of disk

1. Adding v1beta2 disk api group
2. Adding SetAttachState, a function that allows
   changing the disk's online/offline status.
   This is needed because Sanpolicy is not set to
   automount by default. Consequently iSCSI disks
   will not be set online on connection.

Change-Id: I22f10ccd2750d48b5916d01c5b6e9ad11eae521f
@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/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 15, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @jmpfar!

It looks like this is your first PR to kubernetes-csi/csi-proxy 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/csi-proxy has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 15, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @jmpfar. Thanks for your PR.

I'm waiting for a kubernetes-csi 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 the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 15, 2020
Change-Id: I4971b6791e5714422ede03b7f314a1f0b6deb700
@ddebroy
Copy link
Contributor

ddebroy commented Oct 16, 2020

/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 Oct 16, 2020
Copy link
Contributor

@ddebroy ddebroy left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @jmpfar. A couple of suggestions below. Please also add the new API version in modules.txt (as here and update vendor). Otherwise overall structure looks great!


// This test is meant to run on GCE where the page83 ID of the first disk contains
// the host name
func TestDiskAPIGroupV1Beta1(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename TestDiskAPIGroupV1Beta1 to TestDiskAPIGroup as the version will continue to evolve.

Can you also please add a couple of tests for the new online/offline functionality. The test can [1] set the disk offline through powershell directly [2] try to online it through the csi-proxy API and [3] verify disk online status through powershell. The same test can be repeated to offline a disk through csi-proxy API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

rpc DiskStats(DiskStatsRequest) returns (DiskStatsResponse) {}

// SetAttachState sets the offline/online state of a disk
rpc SetAttachState(SetAttachStateRequest) returns (SetAttachStateResponse) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a GetAttachState please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, PTAL

Change-Id: I78ffe57d9388c58afc193570ef35636966f8989b
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 16, 2020
jmpfar and others added 2 commits October 16, 2020 09:12
Change-Id: Ia4b6f809513a964182414658bdebf615e572888d
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 16, 2020
@jmpfar jmpfar marked this pull request as draft October 16, 2020 09:38
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 16, 2020
Change-Id: Iab8cf3a43fe701e84c9ed23e4ea47a8d75a6ed65
Change-Id: Ife44881c4d9e0d03789e4c3b8c323e7b49fe3634
Change-Id: I0bc944e5328986057fa7aae357c89f3153657bfd
Change-Id: Id50df88747d9e9f893ea152a0d14a07aac7c3dea
Change-Id: Iab35b39feda7e92680c961aba2c565481349b747
@jmpfar jmpfar marked this pull request as ready for review October 17, 2020 18:39
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2020
@jmpfar jmpfar changed the title Adding SetAttachState to disk api group Adding GetAttachState and SetAttachState to disk api group Oct 17, 2020
Copy link
Contributor

@ddebroy ddebroy left a comment

Choose a reason for hiding this comment

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

Thanks for the changes and tests!

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ddebroy, jmpfar

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 17, 2020
@k8s-ci-robot k8s-ci-robot merged commit c5d08fd into kubernetes-csi:master Oct 17, 2020
k8s-ci-robot pushed a commit that referenced this pull request Oct 19, 2020
a0f195c Merge pull request #106 from msau42/fix-canary
7100c12 Only set staging registry when running canary job
b3c65f9 Merge pull request #99 from msau42/add-release-process
e53f3e8 Merge pull request #103 from msau42/fix-canary
d129462 Document new method for adding CI jobs are new K8s versions
e73c2ce Use staging registry for canary tests
2c09846 Add cleanup instructions to release-notes generation
60e1cd3 Merge pull request #98 from pohly/kubernetes-1-19-fixes
0979c09 prow.sh: fix E2E suite for Kubernetes >= 1.18
3b4a2f1 prow.sh: fix installing Go for Kubernetes 1.19.0
1fbb636 Merge pull request #97 from pohly/go-1.15
82d108a switch to Go 1.15
d8a2530 Merge pull request #95 from msau42/add-release-process
843bddc Add steps on promoting release images
0345a83 Merge pull request #94 from linux-on-ibm-z/bump-timeout
1fdf2d5 cloud build: bump timeout in Prow job
41ec6d1 Merge pull request #93 from animeshk08/patch-1
5a54e67 filter-junit: Fix gofmt error
0676fcb Merge pull request #92 from animeshk08/patch-1
36ea4ff filter-junit: Fix golint error
f5a4203 Merge pull request #91 from cyb70289/arm64
43e50d6 prow.sh: enable building arm64 image
0d5bd84 Merge pull request #90 from pohly/k8s-staging-sig-storage
3df86b7 cloud build: k8s-staging-sig-storage
c5fd961 Merge pull request #89 from pohly/cloud-build-binfmt
db0c2a7 cloud build: initialize support for running commands in Dockerfile
be902f4 Merge pull request #88 from pohly/multiarch-windows-fix
340e082 build.make: optional inclusion of Windows in multiarch images
5231f05 build.make: properly declare push-multiarch
4569f27 build.make: fix push-multiarch ambiguity
17dde9e Merge pull request #87 from pohly/cloud-build
bd41690 cloud build: initial set of shared files
9084fec Merge pull request #81 from msau42/add-release-process
6f2322e Update patch release notes generation command
0fcc3b1 Merge pull request #78 from ggriffiths/fix_csi_snapshotter_rbac_version_set
d8c76fe Support local snapshot RBAC for pull jobs
c1bdf5b Merge pull request #80 from msau42/add-release-process
ea1f94a update release tools instructions

git-subtree-dir: release-tools
git-subtree-split: a0f195cc2ddc2a1f07d4d3e46fc08187db358f94
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/feature Categorizes issue or PR as related to a new feature. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants