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

Add formatter to errors.Wrapf in driver #241

Merged
merged 1 commit into from
Nov 26, 2018
Merged

Add formatter to errors.Wrapf in driver #241

merged 1 commit into from
Nov 26, 2018

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Nov 26, 2018

Unit test for driver fail with golang v1.11 due to Wrapf call has arguments but no formatting directives error. This patch adds
formatting directives to errors.Wrapf in driver.go for the fix.
Additionally, this PR includes tiny fix in driver.go. Hence it changes
overall:

  • to add formatter to errors.Wrapf
  • to use errors.Wrapf() in run() func.
  • to fix one typo

Issue #, if available:

Fixes #240

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

Unit test for driver fail with golang v1.11 due to `Wrapf call has
arguments but no formatting directives` error. This patch adds
formatting directives to errors.Wrapf in driver.go for the fix.
Additionally, this PR includes tiny fix in driver.go. Hence it changes
overall:

- to add formatter to errors.Wrapf
- to use errors.Wrapf() in run() func.
- to fix one typo
@@ -181,7 +180,7 @@ func setupNS(hostVethName string, contVethName string, netnsPath string, addr *n
// Clean up if hostVeth exists.
if oldHostVeth, err := netLink.LinkByName(hostVethName); err == nil {
if err = netLink.LinkDel(oldHostVeth); err != nil {
return errors.Wrapf(err, "setup NS network: failed to delete old hostVeth", hostVethName)
return errors.Wrapf(err, "setup NS network: failed to delete old hostVeth %q", hostVethName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, thanks for fixing this! I noticed the compile issues with 1.11, but didn't have time to find the cause of the problem yet. Had planned to look at it this week.

Copy link
Contributor

@mattlandis mattlandis left a comment

Choose a reason for hiding this comment

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

lgtm

@mattlandis mattlandis merged commit b995480 into aws:master Nov 26, 2018
@mogren mogren added this to the v1.4 milestone Mar 5, 2019
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.

unit test for driver fail with newer golang such as v1.11
3 participants