diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-07 15:51:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-07 15:51:41 +0200 |
commit | 8a55363b80a012b6c6e774957ac477d0fd540a5e (patch) | |
tree | 97baa90a5f4364ff6731921649441407625fecd7 /pkg/api | |
parent | c20227bd16cae98247955b14f6dfea33a26c6a0b (diff) | |
parent | d1573b95e3427efae21da784e3112c5fb3d463fb (diff) | |
download | podman-8a55363b80a012b6c6e774957ac477d0fd540a5e.tar.gz podman-8a55363b80a012b6c6e774957ac477d0fd540a5e.tar.bz2 podman-8a55363b80a012b6c6e774957ac477d0fd540a5e.zip |
Merge pull request #11459 from vrothberg/fix-11438
generate systemd: handle --restart
Diffstat (limited to 'pkg/api')
-rw-r--r-- | pkg/api/handlers/libpod/generate.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/api/handlers/libpod/generate.go b/pkg/api/handlers/libpod/generate.go index 0e6e9100a..8a2b93d0e 100644 --- a/pkg/api/handlers/libpod/generate.go +++ b/pkg/api/handlers/libpod/generate.go @@ -16,16 +16,15 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) decoder := r.Context().Value("decoder").(*schema.Decoder) query := struct { - Name bool `schema:"useName"` - New bool `schema:"new"` - NoHeader bool `schema:"noHeader"` - RestartPolicy string `schema:"restartPolicy"` - StopTimeout uint `schema:"stopTimeout"` - ContainerPrefix string `schema:"containerPrefix"` - PodPrefix string `schema:"podPrefix"` - Separator string `schema:"separator"` + Name bool `schema:"useName"` + New bool `schema:"new"` + NoHeader bool `schema:"noHeader"` + RestartPolicy *string `schema:"restartPolicy"` + StopTimeout uint `schema:"stopTimeout"` + ContainerPrefix string `schema:"containerPrefix"` + PodPrefix string `schema:"podPrefix"` + Separator string `schema:"separator"` }{ - RestartPolicy: "on-failure", StopTimeout: util.DefaultContainerConfig().Engine.StopTimeout, ContainerPrefix: "container", PodPrefix: "pod", @@ -49,6 +48,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) { PodPrefix: query.PodPrefix, Separator: query.Separator, } + report, err := containerEngine.GenerateSystemd(r.Context(), utils.GetName(r), options) if err != nil { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "error generating systemd units")) |