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/bindings/play/play.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/bindings/play') diff --git a/pkg/bindings/play/play.go b/pkg/bindings/play/play.go index 8af3b8fb1..3861ba87d 100644 --- a/pkg/bindings/play/play.go +++ b/pkg/bindings/play/play.go @@ -32,6 +32,9 @@ func Kube(ctx context.Context, path string, options entities.PlayKubeOptions) (* if options.SkipTLSVerify != types.OptionalBoolUndefined { params.Set("tlsVerify", strconv.FormatBool(options.SkipTLSVerify == types.OptionalBoolTrue)) } + if options.Start != types.OptionalBoolUndefined { + params.Set("start", strconv.FormatBool(options.Start == types.OptionalBoolTrue)) + } // TODO: have a global system context we can pass around (1st argument) header, err := auth.Header(nil, auth.XRegistryAuthHeader, options.Authfile, options.Username, options.Password) -- cgit v1.2.3-54-g00ecf