mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +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,6 +1,7 @@
|
||||
package libpod
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
@ -14,7 +15,6 @@ import (
|
||||
spec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/opencontainers/runtime-tools/generate"
|
||||
"github.com/opencontainers/runtime-tools/validate"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/syndtr/gocapability/capability"
|
||||
)
|
||||
@ -24,15 +24,15 @@ import (
|
||||
func (c *Container) inspectLocked(size bool) (*define.InspectContainerData, error) {
|
||||
storeCtr, err := c.runtime.store.Container(c.ID())
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error getting container from store %q", c.ID())
|
||||
return nil, fmt.Errorf("error getting container from store %q: %w", c.ID(), err)
|
||||
}
|
||||
layer, err := c.runtime.store.Layer(storeCtr.LayerID)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error reading information about layer %q", storeCtr.LayerID)
|
||||
return nil, fmt.Errorf("error reading information about layer %q: %w", storeCtr.LayerID, err)
|
||||
}
|
||||
driverData, err := driver.GetDriverData(c.runtime.store, layer.ID)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error getting graph driver info %q", c.ID())
|
||||
return nil, fmt.Errorf("error getting graph driver info %q: %w", c.ID(), err)
|
||||
}
|
||||
return c.getContainerInspectData(size, driverData)
|
||||
}
|
||||
@ -241,7 +241,7 @@ func (c *Container) GetMounts(namedVolumes []*ContainerNamedVolume, imageVolumes
|
||||
// volume.
|
||||
volFromDB, err := c.runtime.state.Volume(volume.Name)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error looking up volume %s in container %s config", volume.Name, c.ID())
|
||||
return nil, fmt.Errorf("error looking up volume %s in container %s config: %w", volume.Name, c.ID(), err)
|
||||
}
|
||||
mountStruct.Driver = volFromDB.Driver()
|
||||
|
||||
|
Reference in New Issue
Block a user