-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
don't obfuscate error during volume create #32268
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.
LGTM 🐯
LGTM |
daemon/create.go
Outdated
@@ -243,7 +243,7 @@ func (daemon *Daemon) VolumeCreate(name, driverName string, opts, labels map[str | |||
v, err := daemon.volumes.Create(name, driverName, opts, labels) | |||
if err != nil { | |||
if volumestore.IsNameConflict(err) { | |||
return nil, fmt.Errorf("A volume named %s already exists. Choose a different volume name.", name) | |||
return nil, errors.Wrapf(err, "a volume named %s already exists, choose a different volume name") |
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.
missing , name)
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.
oh you are right !
02b0f92
to
8f241ce
Compare
Fixed. |
LGTM |
I think this will lead to very ugly errors. In the simplest case, you'll get:
Adding The only situation where this change would help is if |
@aaronlehmann In the happy case when it's a true name conflict yes, it's not as succinct, however when it's some other issue with a driver it's important to be able to get this information. This is a situation where we've found a volume in the store with the given name but ran into some error while trying to determine if the entry is stale or not. |
Then can we omit this extra layer of wrapping? The error will always contain |
8f241ce
to
90d0978
Compare
Done |
LGTM |
With the current version you can just remove the extra condition as the reporting is same for all errors. To my taste is should be "failed to create volume foo: volume name must be unique". |
90d0978
to
2a15872
Compare
Fixed again. |
@cpuguy83 tests are failing |
Signed-off-by: Brian Goff <[email protected]>
2a15872
to
3b80094
Compare
Tests fixed. |
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.
LGTM (if green 😅
This a new failure?
|
Certainly unrelated. I haven't seen this before, though. |
No description provided.