summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-05 09:20:16 -0400
committerGitHub <noreply@github.com>2021-05-05 09:20:16 -0400
commita278195af3423f882c1f5bb218792f7c2ce10a3c (patch)
tree192e52054de2abf0c92d83ecdbc71d498c2ec947 /pkg/bindings
parent8eefca5a257121b177562742c972e39e1686140d (diff)
parent0f7d54b0260c1be992ee3b9cee359ef3a9e8bd21 (diff)
downloadpodman-a278195af3423f882c1f5bb218792f7c2ce10a3c.tar.gz
podman-a278195af3423f882c1f5bb218792f7c2ce10a3c.tar.bz2
podman-a278195af3423f882c1f5bb218792f7c2ce10a3c.zip
Merge pull request #10147 from vrothberg/new-image-package
migrate Podman to containers/common/libimage
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"))