summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-03-29 09:49:38 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-03-29 09:49:45 -0400
commit127400880a1a3d53d4d4eb454cc9f35ddc89e79a (patch)
tree4ff587426447207a165b4e01d8cea1a8aaa7293e /pkg/api
parentac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad (diff)
downloadpodman-127400880a1a3d53d4d4eb454cc9f35ddc89e79a.tar.gz
podman-127400880a1a3d53d4d4eb454cc9f35ddc89e79a.tar.bz2
podman-127400880a1a3d53d4d4eb454cc9f35ddc89e79a.zip
[NO TESTS NEEDED] Shrink the size of podman-remote
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/images_build.go11
-rw-r--r--pkg/api/handlers/compat/version.go6
-rw-r--r--pkg/api/handlers/types.go4
-rw-r--r--pkg/api/handlers/types/types.go23
4 files changed, 31 insertions, 13 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index 36785a362..fd310711f 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -13,8 +13,7 @@ import (
"time"
"github.com/containers/buildah"
- "github.com/containers/buildah/define"
- "github.com/containers/buildah/imagebuildah"
+ buildahDefine "github.com/containers/buildah/define"
"github.com/containers/buildah/util"
"github.com/containers/image/v5/types"
"github.com/containers/podman/v3/libpod"
@@ -277,13 +276,13 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
jobs = query.Jobs
}
- pullPolicy := define.PullIfMissing
+ pullPolicy := buildahDefine.PullIfMissing
if utils.IsLibpodRequest(r) {
- pullPolicy = define.PolicyMap[query.PullPolicy]
+ pullPolicy = buildahDefine.PolicyMap[query.PullPolicy]
} else {
if _, found := r.URL.Query()["pull"]; found {
if query.Pull {
- pullPolicy = define.PullAlways
+ pullPolicy = buildahDefine.PullAlways
}
}
}
@@ -315,7 +314,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Decode()"))
return
}
- buildOptions := imagebuildah.BuildOptions{
+ buildOptions := buildahDefine.BuildOptions{
AddCapabilities: addCaps,
AdditionalTags: additionalTags,
Annotations: annotations,
diff --git a/pkg/api/handlers/compat/version.go b/pkg/api/handlers/compat/version.go
index fae147440..f1cd77a9a 100644
--- a/pkg/api/handlers/compat/version.go
+++ b/pkg/api/handlers/compat/version.go
@@ -10,8 +10,8 @@ import (
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
"github.com/containers/podman/v3/pkg/domain/entities"
+ "github.com/containers/podman/v3/pkg/domain/entities/types"
"github.com/containers/podman/v3/version"
- docker "github.com/docker/docker/api/types"
"github.com/pkg/errors"
)
@@ -32,7 +32,7 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) {
return
}
- components := []docker.ComponentVersion{{
+ components := []types.ComponentVersion{{
Name: "Podman Engine",
Version: versionInfo.Version,
Details: map[string]string{
@@ -52,7 +52,7 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) {
minVersion := version.APIVersion[version.Compat][version.MinimalAPI]
utils.WriteResponse(w, http.StatusOK, entities.ComponentVersion{
- Version: docker.Version{
+ Version: types.Version{
Platform: struct {
Name string
}{
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index f5eaf6f6d..736203171 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -28,10 +28,6 @@ type ContainerConfig struct {
dockerContainer.Config
}
-type LibpodImagesLoadReport struct {
- ID string `json:"id"`
-}
-
type LibpodImagesPullReport struct {
entities.ImagePullReport
}
diff --git a/pkg/api/handlers/types/types.go b/pkg/api/handlers/types/types.go
new file mode 100644
index 000000000..71165364f
--- /dev/null
+++ b/pkg/api/handlers/types/types.go
@@ -0,0 +1,23 @@
+package types
+
+import (
+ "github.com/containers/podman/v3/pkg/domain/entities"
+)
+
+// LibpodImagesRemoveReport is the return type for image removal via the rest
+// api.
+type LibpodImagesRemoveReport struct {
+ entities.ImageRemoveReport
+ // Image removal requires is to return data and an error.
+ Errors []string
+}
+
+// HistoryResponse provides details on image layers
+type HistoryResponse struct {
+ ID string `json:"Id"`
+ Created int64
+ CreatedBy string
+ Tags []string
+ Size int64
+ Comment string
+}