summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go.mod2
-rw-r--r--go.sum7
-rw-r--r--pkg/api/handlers/compat/swagger.go10
-rw-r--r--pkg/api/handlers/swagger/swagger.go16
-rw-r--r--pkg/api/handlers/types.go1
-rw-r--r--pkg/api/server/register_containers.go6
-rw-r--r--pkg/api/server/register_images.go35
-rw-r--r--pkg/api/server/register_pods.go2
-rw-r--r--pkg/api/server/swagger.go7
-rw-r--r--pkg/machine/fcos.go29
-rw-r--r--vendor/github.com/containers/image/v5/version/version.go2
-rw-r--r--vendor/modules.txt2
12 files changed, 55 insertions, 64 deletions
diff --git a/go.mod b/go.mod
index 9dbde0243..b89854209 100644
--- a/go.mod
+++ b/go.mod
@@ -14,7 +14,7 @@ require (
github.com/containers/buildah v1.22.0
github.com/containers/common v0.42.1
github.com/containers/conmon v2.0.20+incompatible
- github.com/containers/image/v5 v5.15.1
+ github.com/containers/image/v5 v5.15.2
github.com/containers/ocicrypt v1.1.2
github.com/containers/psgo v1.5.2
github.com/containers/storage v1.34.1
diff --git a/go.sum b/go.sum
index fe56bb211..35fe9cdc6 100644
--- a/go.sum
+++ b/go.sum
@@ -246,8 +246,8 @@ github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6J
github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/image/v5 v5.14.0/go.mod h1:SxiBKOcKuT+4yTjD0AskjO+UwFvNcVOJ9qlAw1HNSPU=
github.com/containers/image/v5 v5.15.0/go.mod h1:gzdBcooi6AFdiqfzirUqv90hUyHyI0MMdaqKzACKr2s=
-github.com/containers/image/v5 v5.15.1 h1:WteFDi2CFT9bN7icKvO7e8mVqVkL1b/ZqSEgvWC1RjY=
-github.com/containers/image/v5 v5.15.1/go.mod h1:C7WCwe2hDDYrq39mK6MEgpw8mf/lPTdeofQSJcSFl6k=
+github.com/containers/image/v5 v5.15.2 h1:DKicmVr0h1HGkzs9muoErX+fVbV9sV9W5TyMy5perLE=
+github.com/containers/image/v5 v5.15.2/go.mod h1:8jejVSzTDfyPwr/HXp9rri34n/vbdavYk6IzTiB3TBw=
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b h1:Q8ePgVfHDplZ7U33NwHZkrVELsZP5fYj9pM5WBZB2GE=
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY=
github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc=
@@ -261,7 +261,6 @@ github.com/containers/storage v1.23.5/go.mod h1:ha26Q6ngehFNhf3AWoXldvAvwI4jFe3E
github.com/containers/storage v1.32.6/go.mod h1:mdB+b89p+jU8zpzLTVXA0gWMmIo0WrkfGMh1R8O2IQw=
github.com/containers/storage v1.33.0/go.mod h1:FUZPF4nJijX8ixdhByZJXf02cvbyLi6dyDwXdIe8QVY=
github.com/containers/storage v1.33.1/go.mod h1:FUZPF4nJijX8ixdhByZJXf02cvbyLi6dyDwXdIe8QVY=
-github.com/containers/storage v1.34.0/go.mod h1:t6I+hTgPU0/tVxQ75vw406wDi/TXwYBqZp4QZV9N7b8=
github.com/containers/storage v1.34.1 h1:PsBGMH7hwuQ3MOr7qTgPznFrE8ebfIbwQbg2gKvg0lE=
github.com/containers/storage v1.34.1/go.mod h1:FY2TcbfgCLMU4lYoKnlZeZXeH353TOTbpDEA+sAcqAY=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
@@ -585,7 +584,6 @@ github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
-github.com/klauspost/compress v1.13.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s=
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
@@ -754,7 +752,6 @@ github.com/opencontainers/selinux v1.5.1/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwy
github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE=
github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo=
github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8=
-github.com/opencontainers/selinux v1.8.3/go.mod h1:HTvjPFoGMbpQsG886e3lQwnsRWtE4TC1OF3OUvG9FAo=
github.com/opencontainers/selinux v1.8.4 h1:krlgQ6/j9CkCXT5oW0yVXdQFOME3NjKuuAZXuR6O7P4=
github.com/opencontainers/selinux v1.8.4/go.mod h1:HTvjPFoGMbpQsG886e3lQwnsRWtE4TC1OF3OUvG9FAo=
github.com/openshift/imagebuilder v1.2.2-0.20210415181909-87f3e48c2656 h1:WaxyNFpmIDu4i6so9r6LVFIbSaXqsj8oitMitt86ae4=
diff --git a/pkg/api/handlers/compat/swagger.go b/pkg/api/handlers/compat/swagger.go
index b773799ef..cfbdd1154 100644
--- a/pkg/api/handlers/compat/swagger.go
+++ b/pkg/api/handlers/compat/swagger.go
@@ -2,7 +2,6 @@ package compat
import (
"github.com/containers/podman/v3/pkg/domain/entities"
- "github.com/containers/storage/pkg/archive"
"github.com/docker/docker/api/types"
)
@@ -28,15 +27,6 @@ type swagCtrWaitResponse struct {
}
}
-// Object Changes
-// swagger:response Changes
-type swagChangesResponse struct {
- // in:body
- Body struct {
- Changes []archive.Change
- }
-}
-
// Network inspect
// swagger:response CompatNetworkInspect
type swagCompatNetworkInspect struct {
diff --git a/pkg/api/handlers/swagger/swagger.go b/pkg/api/handlers/swagger/swagger.go
index 83ff5914e..2296eea3a 100644
--- a/pkg/api/handlers/swagger/swagger.go
+++ b/pkg/api/handlers/swagger/swagger.go
@@ -152,13 +152,6 @@ type swagPodTopResponse struct {
}
}
-// List processes in pod
-// swagger:response DocsPodStatsResponse
-type swagPodStatsResponse struct {
- // in:body
- Body []*entities.PodStatsReport
-}
-
// Inspect container
// swagger:response LibpodInspectContainerResponse
type swagLibpodInspectContainerResponse struct {
@@ -183,12 +176,3 @@ type swagInspectPodResponse struct {
define.InspectPodData
}
}
-
-// Inspect volume
-// swagger:response InspectVolumeResponse
-type swagInspectVolumeResponse struct {
- // in:body
- Body struct {
- define.InspectVolumeData
- }
-}
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index af5878798..b82c586ea 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -104,6 +104,7 @@ type ContainerWaitOKBody struct {
}
// CreateContainerConfig used when compatible endpoint creates a container
+// swagger:model CreateContainerConfig
type CreateContainerConfig struct {
Name string // container name
dockerContainer.Config // desired container configuration
diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go
index 0ec4f95d9..b36cb75f1 100644
--- a/pkg/api/server/register_containers.go
+++ b/pkg/api/server/register_containers.go
@@ -21,6 +21,12 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// name: name
// type: string
// description: container name
+ // - in: body
+ // name: body
+ // description: Container to create
+ // schema:
+ // $ref: "#/definitions/CreateContainerConfig"
+ // required: true
// responses:
// 201:
// $ref: "#/responses/ContainerCreateResponse"
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index 1c61f7f84..2630acac2 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -25,6 +25,10 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// produces:
// - application/json
// parameters:
+ // - in: header
+ // name: X-Registry-Auth
+ // type: string
+ // description: A base64-encoded auth configuration.
// - in: query
// name: fromImage
// type: string
@@ -49,13 +53,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// name: platform
// type: string
// description: Platform in the format os[/arch[/variant]]
- // default: ""
- // - in: header
- // name: X-Registry-Auth
- // type: string
- // description: A base64-encoded auth configuration.
// - in: body
- // name: request
+ // name: inputImage
// schema:
// type: string
// format: binary
@@ -472,6 +471,14 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// summary: Create image
// description: Build an image from the given Dockerfile(s)
// parameters:
+ // - in: header
+ // name: Content-Type
+ // type: string
+ // default: application/x-tar
+ // enum: ["application/x-tar"]
+ // - in: header
+ // name: X-Registry-Config
+ // type: string
// - in: query
// name: dockerfile
// type: string
@@ -653,6 +660,14 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: |
// output configuration TBD
// (As of version 1.xx)
+ // - in: body
+ // name: inputStream
+ // description: |
+ // A tar archive compressed with one of the following algorithms:
+ // identity (no compression), gzip, bzip2, xz.
+ // schema:
+ // type: string
+ // format: binary
// produces:
// - application/json
// responses:
@@ -852,6 +867,11 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// summary: Import image
// description: Import a previously exported tarball as an image.
// parameters:
+ // - in: header
+ // name: Content-Type
+ // type: string
+ // default: application/x-tar
+ // enum: ["application/x-tar"]
// - in: query
// name: changes
// description: "Apply the following possible instructions to the created image: CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR. JSON encoded string"
@@ -875,7 +895,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// required: true
// description: tarball for imported image
// schema:
- // type: "string"
+ // type: string
+ // format: binary
// produces:
// - application/json
// consumes:
diff --git a/pkg/api/server/register_pods.go b/pkg/api/server/register_pods.go
index 58234005e..de3669a0a 100644
--- a/pkg/api/server/register_pods.go
+++ b/pkg/api/server/register_pods.go
@@ -51,7 +51,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// responses:
// 201:
// schema:
- // $ref: "#/definitions/IdResponse"
+ // $ref: "#/definitions/IDResponse"
// 400:
// $ref: "#/responses/BadParamError"
// 409:
diff --git a/pkg/api/server/swagger.go b/pkg/api/server/swagger.go
index d282edf23..0fd66652e 100644
--- a/pkg/api/server/swagger.go
+++ b/pkg/api/server/swagger.go
@@ -141,13 +141,6 @@ type swagImageSummary struct {
Body []entities.ImageSummary
}
-// Registries summary
-// swagger:response DocsRegistriesList
-type swagRegistriesList struct {
- // in:body
- Body entities.ListRegistriesReport
-}
-
// List Containers
// swagger:response DocsListContainer
type swagListContainers struct {
diff --git a/pkg/machine/fcos.go b/pkg/machine/fcos.go
index 11936aee7..49ec01e67 100644
--- a/pkg/machine/fcos.go
+++ b/pkg/machine/fcos.go
@@ -3,14 +3,14 @@
package machine
import (
- "crypto/sha256"
- "io/ioutil"
url2 "net/url"
+ "os"
"path/filepath"
"runtime"
"strings"
digest "github.com/opencontainers/go-digest"
+ "github.com/sirupsen/logrus"
)
// These should eventually be moved into machine/qemu as
@@ -91,24 +91,23 @@ func UpdateAvailable(d *Download) (bool, error) {
// check the sha of the local image if it exists
// get the sha of the remote image
// == dont bother to pull
- files, err := ioutil.ReadDir(filepath.Dir(d.LocalPath))
+ if _, err := os.Stat(d.LocalPath); os.IsNotExist(err) {
+ return false, nil
+ }
+ fd, err := os.Open(d.LocalPath)
if err != nil {
return false, err
}
- for _, file := range files {
- if filepath.Base(d.LocalPath) == file.Name() {
- b, err := ioutil.ReadFile(d.LocalPath)
- if err != nil {
- return false, err
- }
- s := sha256.Sum256(b)
- sum := digest.NewDigestFromBytes(digest.SHA256, s[:])
- if sum.Encoded() == d.Sha256sum {
- return true, nil
- }
+ defer func() {
+ if err := fd.Close(); err != nil {
+ logrus.Error(err)
}
+ }()
+ sum, err := digest.SHA256.FromReader(fd)
+ if err != nil {
+ return false, err
}
- return false, nil
+ return sum.Encoded() == d.Sha256sum, nil
}
func getFcosArch() string {
diff --git a/vendor/github.com/containers/image/v5/version/version.go b/vendor/github.com/containers/image/v5/version/version.go
index 7665a4c00..478a03b05 100644
--- a/vendor/github.com/containers/image/v5/version/version.go
+++ b/vendor/github.com/containers/image/v5/version/version.go
@@ -8,7 +8,7 @@ const (
// VersionMinor is for functionality in a backwards-compatible manner
VersionMinor = 15
// VersionPatch is for backwards-compatible bug fixes
- VersionPatch = 1
+ VersionPatch = 2
// VersionDev indicates development branch. Releases will be empty string.
VersionDev = ""
diff --git a/vendor/modules.txt b/vendor/modules.txt
index d791c9cfc..678a884ea 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -126,7 +126,7 @@ github.com/containers/common/pkg/umask
github.com/containers/common/version
# github.com/containers/conmon v2.0.20+incompatible
github.com/containers/conmon/runner/config
-# github.com/containers/image/v5 v5.15.1
+# github.com/containers/image/v5 v5.15.2
github.com/containers/image/v5/copy
github.com/containers/image/v5/directory
github.com/containers/image/v5/directory/explicitfilepath