summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/images/pull.go4
-rw-r--r--pkg/bindings/test/images_test.go4
-rw-r--r--pkg/bindings/test/system_test.go11
3 files changed, 5 insertions, 14 deletions
diff --git a/pkg/bindings/images/pull.go b/pkg/bindings/images/pull.go
index f4da2d521..9780c3bff 100644
--- a/pkg/bindings/images/pull.go
+++ b/pkg/bindings/images/pull.go
@@ -3,7 +3,6 @@ package images
import (
"context"
"encoding/json"
- "errors"
"fmt"
"io"
"io/ioutil"
@@ -15,6 +14,7 @@ import (
"github.com/containers/podman/v3/pkg/bindings"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/hashicorp/go-multierror"
+ "github.com/pkg/errors"
)
// Pull is the binding for libpod's v2 endpoints for pulling images. Note that
@@ -91,7 +91,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string,
images = report.Images
case report.ID != "":
default:
- return images, errors.New("failed to parse pull results stream, unexpected input")
+ return images, errors.Errorf("failed to parse pull results stream, unexpected input: %v", report)
}
}
return images, mErr
diff --git a/pkg/bindings/test/images_test.go b/pkg/bindings/test/images_test.go
index 688bf049f..ff8f72c85 100644
--- a/pkg/bindings/test/images_test.go
+++ b/pkg/bindings/test/images_test.go
@@ -9,7 +9,6 @@ import (
"github.com/containers/podman/v3/pkg/bindings"
"github.com/containers/podman/v3/pkg/bindings/containers"
"github.com/containers/podman/v3/pkg/bindings/images"
- dreports "github.com/containers/podman/v3/pkg/domain/entities/reports"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
@@ -116,7 +115,7 @@ var _ = Describe("Podman images", func() {
// Removing the image "alpine" where force = true
options := new(images.RemoveOptions).WithForce(true)
response, errs = images.Remove(bt.conn, []string{alpine.shortName}, options)
- Expect(len(errs)).To(BeZero())
+ Expect(errs).To(BeNil())
// To be extra sure, check if the previously created container
// is gone as well.
_, err = containers.Inspect(bt.conn, "top", nil)
@@ -346,7 +345,6 @@ var _ = Describe("Podman images", func() {
results, err := images.Prune(bt.conn, options)
Expect(err).NotTo(HaveOccurred())
Expect(len(results)).To(BeNumerically(">", 0))
- Expect(dreports.PruneReportsIds(results)).To(ContainElement("docker.io/library/alpine:latest"))
})
// TODO: we really need to extent to pull tests once we have a more sophisticated CI.
diff --git a/pkg/bindings/test/system_test.go b/pkg/bindings/test/system_test.go
index 68e9d9301..aecc5db81 100644
--- a/pkg/bindings/test/system_test.go
+++ b/pkg/bindings/test/system_test.go
@@ -83,8 +83,6 @@ var _ = Describe("Podman system", func() {
Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(1))
Expect(len(systemPruneResponse.ImagePruneReports)).
To(BeNumerically(">", 0))
- Expect(reports.PruneReportsIds(systemPruneResponse.ImagePruneReports)).
- To(ContainElement("docker.io/library/alpine:latest"))
Expect(len(systemPruneResponse.VolumePruneReports)).To(Equal(0))
})
@@ -193,13 +191,8 @@ var _ = Describe("Podman system", func() {
systemPruneResponse, err := system.Prune(bt.conn, options)
Expect(err).To(BeNil())
Expect(len(systemPruneResponse.PodPruneReport)).To(Equal(0))
- // TODO fix system filter handling so all components can handle filters
- // This check **should** be "Equal(0)" since we are passing label
- // filters however the Prune function doesn't seem to pass filters
- // to each component.
- Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(1))
- Expect(len(systemPruneResponse.ImagePruneReports)).
- To(BeNumerically(">", 0))
+ Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(0))
+ Expect(len(systemPruneResponse.ImagePruneReports)).To(Equal(0))
// Alpine image should not be pruned as used by running container
Expect(reports.PruneReportsIds(systemPruneResponse.ImagePruneReports)).
ToNot(ContainElement("docker.io/library/alpine:latest"))