From 7ab936eafad504fd6a0b7bfec3f6dafe322ad09d Mon Sep 17 00:00:00 2001 From: Alban Bedel Date: Mon, 16 Nov 2020 21:46:42 +0100 Subject: Add an option to control if play kube should start the pod Having play kube start the pod is not always appropriate, one might for example like to have the pod running as a set of systemd services. Add a `start` option to the command line and API to control if the pod should be started or not; it defaults to true for backward compatibility. Signed-off-by: Alban Bedel --- pkg/api/handlers/libpod/play.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/api/handlers/libpod') diff --git a/pkg/api/handlers/libpod/play.go b/pkg/api/handlers/libpod/play.go index 0c7a6e19d..42ff26a57 100644 --- a/pkg/api/handlers/libpod/play.go +++ b/pkg/api/handlers/libpod/play.go @@ -23,8 +23,10 @@ func PlayKube(w http.ResponseWriter, r *http.Request) { Network string `schema:"reference"` TLSVerify bool `schema:"tlsVerify"` LogDriver string `schema:"logDriver"` + Start bool `schema:"start"` }{ TLSVerify: true, + Start: true, } if err := decoder.Decode(&query, r.URL.Query()); err != nil { @@ -73,6 +75,9 @@ func PlayKube(w http.ResponseWriter, r *http.Request) { if _, found := r.URL.Query()["tlsVerify"]; found { options.SkipTLSVerify = types.NewOptionalBool(!query.TLSVerify) } + if _, found := r.URL.Query()["start"]; found { + options.Start = types.NewOptionalBool(query.Start) + } report, err := containerEngine.PlayKube(r.Context(), tmpfile.Name(), options) if err != nil { -- cgit v1.2.3-54-g00ecf