summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/container.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-11-13 20:19:54 +0100
committerGitHub <noreply@github.com>2019-11-13 20:19:54 +0100
commit225f22b9d5dfd0d1582a56530142fe8ffb960a91 (patch)
tree4dcc994bb1e48602e5be5f42b7599abdc0cc7937 /vendor/github.com/fsouza/go-dockerclient/container.go
parent15220af08ce2346686e54851a6d498ec573e950c (diff)
parent6003033adae775f1d725b05231a246a4462ae669 (diff)
downloadpodman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.tar.gz
podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.tar.bz2
podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.zip
Merge pull request #4506 from TomSweeneyRedHat/dev/tsweeney/bump_buildah1.11.5
Bump to Buildah v1.11.5
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/container.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/container.go30
1 files changed, 22 insertions, 8 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/container.go b/vendor/github.com/fsouza/go-dockerclient/container.go
index 0a8ab361c..f6bfb59dc 100644
--- a/vendor/github.com/fsouza/go-dockerclient/container.go
+++ b/vendor/github.com/fsouza/go-dockerclient/container.go
@@ -546,26 +546,31 @@ func (c *Client) RenameContainer(opts RenameContainerOptions) error {
// InspectContainer returns information about a container by its ID.
//
-// See https://goo.gl/FaI5JT for more details.
+// Deprecated: Use InspectContainerWithOptions instead.
func (c *Client) InspectContainer(id string) (*Container, error) {
- return c.inspectContainer(id, doOptions{})
+ return c.InspectContainerWithOptions(InspectContainerOptions{ID: id})
}
// InspectContainerWithContext returns information about a container by its ID.
// The context object can be used to cancel the inspect request.
//
-// See https://goo.gl/FaI5JT for more details.
+// Deprecated: Use InspectContainerWithOptions instead.
//nolint:golint
func (c *Client) InspectContainerWithContext(id string, ctx context.Context) (*Container, error) {
- return c.inspectContainer(id, doOptions{context: ctx})
+ return c.InspectContainerWithOptions(InspectContainerOptions{ID: id, Context: ctx})
}
-func (c *Client) inspectContainer(id string, opts doOptions) (*Container, error) {
- path := "/containers/" + id + "/json"
- resp, err := c.do(http.MethodGet, path, opts)
+// InspectContainerWithOptions returns information about a container by its ID.
+//
+// See https://goo.gl/FaI5JT for more details.
+func (c *Client) InspectContainerWithOptions(opts InspectContainerOptions) (*Container, error) {
+ path := "/containers/" + opts.ID + "/json?" + queryString(opts)
+ resp, err := c.do(http.MethodGet, path, doOptions{
+ context: opts.Context,
+ })
if err != nil {
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
- return nil, &NoSuchContainer{ID: id}
+ return nil, &NoSuchContainer{ID: opts.ID}
}
return nil, err
}
@@ -577,6 +582,15 @@ func (c *Client) inspectContainer(id string, opts doOptions) (*Container, error)
return &container, nil
}
+// InspectContainerOptions specifies parameters for InspectContainerWithOptions.
+//
+// See https://goo.gl/FaI5JT for more details.
+type InspectContainerOptions struct {
+ Context context.Context
+ ID string `qs:"-"`
+ Size bool
+}
+
// ContainerChanges returns changes in the filesystem of the given container.
//
// See https://goo.gl/15KKzh for more details.