summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-17 22:40:28 +0100
committerGitHub <noreply@github.com>2020-11-17 22:40:28 +0100
commit770b03a50cbffbf1ad1d40a8c9ea72860727acea (patch)
treea9f3704b068fc111ed51c9aeadd7b5392c11432e /pkg/api
parent0886fabbc233261008cc38ee07dea238bcf4de86 (diff)
parent7ab936eafad504fd6a0b7bfec3f6dafe322ad09d (diff)
downloadpodman-770b03a50cbffbf1ad1d40a8c9ea72860727acea.tar.gz
podman-770b03a50cbffbf1ad1d40a8c9ea72860727acea.tar.bz2
podman-770b03a50cbffbf1ad1d40a8c9ea72860727acea.zip
Merge pull request #8363 from AlbanBedel/play-kube-create-only
Add an option to control if play kube should start the pod
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/play.go5
-rw-r--r--pkg/api/server/register_play.go5
2 files changed, 10 insertions, 0 deletions
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 {
diff --git a/pkg/api/server/register_play.go b/pkg/api/server/register_play.go
index e41f8311d..6aa349a3b 100644
--- a/pkg/api/server/register_play.go
+++ b/pkg/api/server/register_play.go
@@ -29,6 +29,11 @@ func (s *APIServer) registerPlayHandlers(r *mux.Router) error {
// name: logDriver
// type: string
// description: Logging driver for the containers in the pod.
+ // - in: query
+ // name: start
+ // type: boolean
+ // default: true
+ // description: Start the pod after creating it.
// - in: body
// name: request
// description: Kubernetes YAML file.