mirror of
https://github.com/containers/podman.git
synced 2025-06-19 00:06:43 +08:00
Merge pull request #9516 from rhatdan/shrink
[NO TESTS NEEDED] Shrink the size of podman bindings
This commit is contained in:
@ -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,
|
||||
|
@ -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
|
||||
}{
|
||||
|
@ -28,10 +28,6 @@ type ContainerConfig struct {
|
||||
dockerContainer.Config
|
||||
}
|
||||
|
||||
type LibpodImagesLoadReport struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
type LibpodImagesPullReport struct {
|
||||
entities.ImagePullReport
|
||||
}
|
||||
|
23
pkg/api/handlers/types/types.go
Normal file
23
pkg/api/handlers/types/types.go
Normal file
@ -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
|
||||
}
|
Reference in New Issue
Block a user