Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Conversation

simrannagra
Copy link
Contributor

What this PR does / why we need it:This PR updates Volume delete interface

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

@coveralls
Copy link

Pull Request Test Coverage Report for Build 214

  • 11 of 14 (78.57%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 69.713%

Changes Missing Coverage Covered Lines Changed/Added Lines %
openstack/blockstorage/v2/volumes/requests.go 11 14 78.57%
Totals Coverage Status
Change from base Build 213: 0.002%
Covered Lines: 11253
Relevant Lines: 16142

💛 - Coveralls

@coveralls
Copy link

coveralls commented Sep 17, 2018

Pull Request Test Coverage Report for Build 244

  • 11 of 14 (78.57%) changed or added relevant lines in 1 file are covered.
  • 203 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.05%) to 69.659%

Changes Missing Coverage Covered Lines Changed/Added Lines %
openstack/blockstorage/v2/volumes/requests.go 11 14 78.57%
Files with Coverage Reduction New Missed Lines %
openstack/csbs/v1/backup/results.go 3 88.89%
service_client.go 8 8.57%
openstack/compute/v2/extensions/schedulerhints/requests.go 36 56.63%
provider_client.go 50 51.12%
openstack/client.go 106 25.81%
Totals Coverage Status
Change from base Build 213: -0.05%
Covered Lines: 11266
Relevant Lines: 16173

💛 - Coveralls

@Savasw
Copy link
Contributor

Savasw commented Sep 17, 2018

@niuzhenguo This PR adds capability to delete EVS disk with cascading option so that snapshots are deleted first in order to facilitate successful volume deletion. This is useful in VBS acc tests.

func Delete(client *golangsdk.ServiceClient, id string, opts DeleteOptsBuilder) (r DeleteResult) {
url := deleteURL(client, id)

q, err := opts.ToVolumeDeleteQuery()
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to add a check before line 84, which is 'if opts != nil'. If pass a nil value for 'opts', it will raise a panic to invoke 'ToVolumeDeleteQuery' directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

root@chenzeng-server:/go_workspace/workspace/src/test# cat t.go
package main

type Builder interface {
To() (string, error)
}

func f1(b Builder) {
b.To()
}

func main() {
f1(nil)
}

root@chenzeng-server:/go_workspace/workspace/src/test# go run t.go

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x44c172]

goroutine 1 [running]:
main.f1(0x0, 0x0)
/go_workspace/workspace/src/test/t.go:8 +0x22
main.main()
/go_workspace/workspace/src/test/t.go:12 +0x29
exit status 2

Copy link
Contributor

Choose a reason for hiding this comment

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

It must check b in func f1

@zengchen1024 zengchen1024 merged commit 9cb80ac into huaweicloud:master Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants