From 8fbe06b8cbd8e3bc425d83130d562eb0c19f309b Mon Sep 17 00:00:00 2001 From: "wuhua.ck" Date: Thu, 15 Apr 2021 22:36:50 +0800 Subject: add flag "--pidfile" for podman create/run Signed-off-by: chenkang --- pkg/specgen/generate/container_create.go | 3 +++ pkg/specgen/specgen.go | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'pkg') diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go index ef9975021..13d4b4926 100644 --- a/pkg/specgen/generate/container_create.go +++ b/pkg/specgen/generate/container_create.go @@ -375,6 +375,9 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen. } options = append(options, libpod.WithDependencyCtrs(deps)) } + if s.PidFile != "" { + options = append(options, libpod.WithPidFile(s.PidFile)) + } return options, nil } diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index 28111f96d..e3d4b1436 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -171,6 +171,10 @@ type ContainerBasicConfig struct { // container. Dependencies can be specified by name or full/partial ID. // Optional. DependencyContainers []string `json:"dependencyContainers,omitempty"` + // PidFile is the file that saves container process id. + // set tags as `json:"-"` for not supported remote + // Optional. + PidFile string `json:"-"` } // ContainerStorageConfig contains information on the storage configuration of a -- cgit v1.2.3-54-g00ecf