summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-13 18:06:54 +0100
committerGitHub <noreply@github.com>2022-01-13 18:06:54 +0100
commiteeb76db0fd0dc2a1115c2f2ad12c82eadbc62509 (patch)
tree4666b0a66a98bd3f29586b3d3ac2c3028bd7443a /pkg/api/handlers
parentab7228b3c27719e447de4dffe9b3fd7f67d6f346 (diff)
parentece768ff9e7d2b0166c0b1850467a489556b93fc (diff)
downloadpodman-eeb76db0fd0dc2a1115c2f2ad12c82eadbc62509.tar.gz
podman-eeb76db0fd0dc2a1115c2f2ad12c82eadbc62509.tar.bz2
podman-eeb76db0fd0dc2a1115c2f2ad12c82eadbc62509.zip
Merge pull request #12642 from Luap99/libnetwork
use libnetwork from c/common
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/images_build.go12
-rw-r--r--pkg/api/handlers/compat/networks.go4
-rw-r--r--pkg/api/handlers/libpod/networks.go2
-rw-r--r--pkg/api/handlers/libpod/swagger.go2
4 files changed, 8 insertions, 12 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index 2d296b5ce..6d4fe5513 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -16,7 +16,6 @@ import (
"github.com/containers/buildah"
buildahDefine "github.com/containers/buildah/define"
"github.com/containers/buildah/pkg/parse"
- "github.com/containers/buildah/util"
"github.com/containers/image/v5/types"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
@@ -74,6 +73,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
AdditionalCapabilities string `schema:"addcaps"`
Annotations string `schema:"annotations"`
AppArmor string `schema:"apparmor"`
+ AllPlatforms bool `schema:"allplatforms"`
BuildArgs string `schema:"buildargs"`
CacheFrom string `schema:"cachefrom"`
Compression uint64 `schema:"compression"`
@@ -122,6 +122,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Target string `schema:"target"`
Timestamp int64 `schema:"timestamp"`
Ulimits string `schema:"ulimits"`
+ UnsetEnvs []string `schema:"unsetenv"`
Secrets string `schema:"secrets"`
}{
Dockerfile: "Dockerfile",
@@ -491,16 +492,12 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
defer reporter.Close()
runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)
- rtc, err := runtime.GetConfig()
- if err != nil {
- utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Decode()"))
- return
- }
buildOptions := buildahDefine.BuildOptions{
AddCapabilities: addCaps,
AdditionalTags: additionalTags,
Annotations: annotations,
Args: buildArgs,
+ AllPlatforms: query.AllPlatforms,
CommonBuildOpts: &buildah.CommonBuildOptions{
AddHost: addhosts,
ApparmorProfile: apparmor,
@@ -522,8 +519,6 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Ulimit: ulimits,
Secrets: secrets,
},
- CNIConfigDir: rtc.Network.CNIPluginDirs[0],
- CNIPluginPath: util.DefaultCNIPluginPath,
Compression: compression,
ConfigureNetwork: parseNetworkConfigurationPolicy(query.ConfigureNetwork),
ContextDirectory: contextDirectory,
@@ -556,6 +551,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Squash: query.Squash,
Target: query.Target,
SystemContext: systemContext,
+ UnsetEnvs: query.UnsetEnvs,
}
for _, platformSpec := range query.Platform {
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go
index db3af7d0b..3345a9cfe 100644
--- a/pkg/api/handlers/compat/networks.go
+++ b/pkg/api/handlers/compat/networks.go
@@ -6,10 +6,10 @@ import (
"net"
"net/http"
+ nettypes "github.com/containers/common/libnetwork/types"
+ netutil "github.com/containers/common/libnetwork/util"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
- nettypes "github.com/containers/podman/v3/libpod/network/types"
- netutil "github.com/containers/podman/v3/libpod/network/util"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
api "github.com/containers/podman/v3/pkg/api/types"
"github.com/containers/podman/v3/pkg/domain/entities"
diff --git a/pkg/api/handlers/libpod/networks.go b/pkg/api/handlers/libpod/networks.go
index a28c3c57c..d140ec07f 100644
--- a/pkg/api/handlers/libpod/networks.go
+++ b/pkg/api/handlers/libpod/networks.go
@@ -4,9 +4,9 @@ import (
"encoding/json"
"net/http"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
api "github.com/containers/podman/v3/pkg/api/types"
"github.com/containers/podman/v3/pkg/domain/entities"
diff --git a/pkg/api/handlers/libpod/swagger.go b/pkg/api/handlers/libpod/swagger.go
index 8d7058b1e..db93d7ac6 100644
--- a/pkg/api/handlers/libpod/swagger.go
+++ b/pkg/api/handlers/libpod/swagger.go
@@ -4,9 +4,9 @@ import (
"net/http"
"os"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/image/v5/manifest"
"github.com/containers/podman/v3/libpod/define"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/pkg/errors"