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

Using correct error to construct CannotRemoveVolumeError #2059

Merged
merged 2 commits into from
May 31, 2019

Conversation

yhlee-aws
Copy link
Contributor

Summary

We are constructing CannotRemoveVolumeError with wrong docker error, which can result in nullpointer

Implementation details

Using the correct docker error object

Testing

New tests cover the changes:

Description for the changelog

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yhlee-aws yhlee-aws added this to the 1.28.1 milestone May 31, 2019
Copy link
Contributor

@sharanyad sharanyad left a comment

Choose a reason for hiding this comment

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

ok := client.VolumeRemove(ctx, name, false)
if ok != nil {
return &CannotRemoveVolumeError{err}
removeErr := client.VolumeRemove(ctx, name, false)
Copy link
Contributor

@sharanyad sharanyad May 31, 2019

Choose a reason for hiding this comment

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

nit: this can just be err

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 wanted to make it very distinctively separate from the err above this, but I don't feel strongly about it, I'll update it to use err for consistency.

@yhlee-aws
Copy link
Contributor Author

yhlee-aws commented May 31, 2019

Could you also add an assert here for err.Error() here https://github.com/aws/amazon-ecs-agent/blob/master/agent/dockerclient/dockerapi/docker_client_test.go#L1626?

Added.

Copy link
Contributor

@sharanyad sharanyad left a comment

Choose a reason for hiding this comment

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

this needs a changelog entry

@yhlee-aws yhlee-aws merged commit c43930c into aws:dev May 31, 2019
@fenxiong fenxiong mentioned this pull request May 31, 2019
@yhlee-aws yhlee-aws deleted the volume_remove_err branch July 3, 2019 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants