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

Implementing ListSnapshots #286

Merged
merged 3 commits into from
May 11, 2019

Conversation

zacharya
Copy link
Contributor

Is this a bug fix or adding new feature?
Fixes: #233

What is this PR about? / Why do we need it?
This implements ListSnapshots from the CSI spec (not yet used by Kubernetes).

What testing is done?
Unit tests have been written for driver and cloud packages that handle both happy path and error cases.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 25, 2019
@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 Apr 25, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @zacharya. Thanks for your PR.

I'm waiting for a kubernetes-sigs or 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 the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 25, 2019
@coveralls
Copy link

coveralls commented Apr 25, 2019

Pull Request Test Coverage Report for Build 623

  • 104 of 114 (91.23%) changed or added relevant lines in 2 files are covered.
  • 115 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.7%) to 70.966%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/cloud/cloud.go 49 51 96.08%
pkg/driver/controller.go 55 63 87.3%
Files with Coverage Reduction New Missed Lines %
pkg/cloud/cloud.go 56 75.26%
pkg/driver/controller.go 59 72.05%
Totals Coverage Status
Change from base Build 607: 1.7%
Covered Lines: 1073
Relevant Lines: 1512

💛 - Coveralls

@leakingtapan
Copy link
Contributor

/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 26, 2019
Copy link
Contributor

@leakingtapan leakingtapan left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Left some comments. Also could you add some details on how is this being tested?

pkg/cloud/cloud.go Outdated Show resolved Hide resolved
func (c *cloud) ListSnapshots(ctx context.Context, volumeID string, maxResults int64, nextToken string) (listSnapshotsResponse *ListSnapshotsResponse, err error) {
describeSnapshotsInput := &ec2.DescribeSnapshotsInput{}

if maxResults >= 5 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since controller.ListSnapshots already has logic to guarantee maxResults >= 5, as cloud is an internal struct, I feel we can just set describeSnapshotsInput.MaxResults = aws.Int64(maxResults) without checking if maxResults >= 5 {.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just pushed another commit that enabled ListSnapshot sanity testing. In order to satisfy the unit tests from the sanity testing packages, I had to push the logic down into the cloud package so controller was able to handle 0 < MaxEntries < 5. Let me know how you want to proceed with this. It's mostly cosmetic as we're just using fakeCloudProvider anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

If that's what the sanity test checks, im okay with the change.

pkg/cloud/cloud.go Show resolved Hide resolved
pkg/cloud/cloud_test.go Show resolved Hide resolved
@zacharya
Copy link
Contributor Author

zacharya commented May 8, 2019

/retest

@leakingtapan
Copy link
Contributor

/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 May 11, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leakingtapan, zacharya

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 May 11, 2019
@leakingtapan
Copy link
Contributor

/retest

1 similar comment
@zacharya
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 67f791d into kubernetes-sigs:master May 11, 2019
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. 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. 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.

Implement ListSnapshot
4 participants