mirror of
https://github.com/containers/podman.git
synced 2025-06-19 08:09:12 +08:00
Update podman to use containers.conf
Add more default options parsing Switch to using --time as opposed to --timeout to better match Docker. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -46,12 +46,12 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
|
||||
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "NewFromLocal()"))
|
||||
return
|
||||
}
|
||||
defaultContainerConfig, err := runtime.GetConfig()
|
||||
containerConfig, err := runtime.GetConfig()
|
||||
if err != nil {
|
||||
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "GetConfig()"))
|
||||
return
|
||||
}
|
||||
cc, err := makeCreateConfig(defaultContainerConfig, input, newImage)
|
||||
cc, err := makeCreateConfig(containerConfig, input, newImage)
|
||||
if err != nil {
|
||||
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "makeCreatConfig()"))
|
||||
return
|
||||
@ -60,7 +60,7 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
|
||||
utils.CreateContainer(r.Context(), w, runtime, &cc)
|
||||
}
|
||||
|
||||
func makeCreateConfig(defaultContainerConfig *config.Config, input handlers.CreateContainerConfig, newImage *image2.Image) (createconfig.CreateConfig, error) {
|
||||
func makeCreateConfig(containerConfig *config.Config, input handlers.CreateContainerConfig, newImage *image2.Image) (createconfig.CreateConfig, error) {
|
||||
var (
|
||||
err error
|
||||
init bool
|
||||
@ -81,7 +81,7 @@ func makeCreateConfig(defaultContainerConfig *config.Config, input handlers.Crea
|
||||
workDir = input.WorkingDir
|
||||
}
|
||||
|
||||
stopTimeout := defaultContainerConfig.Engine.StopTimeout
|
||||
stopTimeout := containerConfig.Engine.StopTimeout
|
||||
if input.StopTimeout != nil {
|
||||
stopTimeout = uint(*input.StopTimeout)
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/containers/common/pkg/sysinfo"
|
||||
"github.com/containers/libpod/libpod"
|
||||
"github.com/containers/libpod/libpod/define"
|
||||
"github.com/containers/libpod/pkg/api/handlers"
|
||||
"github.com/containers/libpod/pkg/api/handlers/utils"
|
||||
"github.com/containers/libpod/pkg/rootless"
|
||||
"github.com/containers/libpod/pkg/sysinfo"
|
||||
docker "github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/google/uuid"
|
||||
|
Reference in New Issue
Block a user