mirror of
https://github.com/containers/podman.git
synced 2025-07-01 16:17:06 +08:00
libpod: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of the deprecated github.com/pkg/errors package. [NO NEW TESTS NEEDED] Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
package libpod
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/containers/podman/v4/libpod/define"
|
||||
pluginapi "github.com/docker/go-plugins-helpers/volume"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -29,7 +30,7 @@ func (v *Volume) Inspect() (*define.InspectVolumeData, error) {
|
||||
data.Mountpoint = v.state.MountPoint
|
||||
|
||||
if v.plugin == nil {
|
||||
return nil, errors.Wrapf(define.ErrMissingPlugin, "volume %s uses volume plugin %s but it is not available, cannot inspect", v.Name(), v.config.Driver)
|
||||
return nil, fmt.Errorf("volume %s uses volume plugin %s but it is not available, cannot inspect: %w", v.Name(), v.config.Driver, define.ErrMissingPlugin)
|
||||
}
|
||||
|
||||
// Retrieve status for the volume.
|
||||
@ -38,7 +39,7 @@ func (v *Volume) Inspect() (*define.InspectVolumeData, error) {
|
||||
req.Name = v.Name()
|
||||
resp, err := v.plugin.GetVolume(req)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error retrieving volume %s information from plugin %s", v.Name(), v.Driver())
|
||||
return nil, fmt.Errorf("error retrieving volume %s information from plugin %s: %w", v.Name(), v.Driver(), err)
|
||||
}
|
||||
if resp != nil {
|
||||
data.Status = resp.Status
|
||||
|
Reference in New Issue
Block a user