-
Notifications
You must be signed in to change notification settings - Fork 618
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
ok := client.VolumeRemove(ctx, name, false) | ||
if ok != nil { | ||
return &CannotRemoveVolumeError{err} | ||
removeErr := client.VolumeRemove(ctx, name, false) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Added. |
18dd6c8
to
e4422e0
Compare
There was a problem hiding this 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
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.