mirror of
https://github.com/containers/podman.git
synced 2025-08-03 01:37:51 +08:00
Fix podman pod create --infra-command and --infra-image
Currently infr-command and --infra-image commands are ignored from the user. This PR instruments them and adds tests for each combination. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -1659,6 +1659,36 @@ func WithUmask(umask string) CtrCreateOption {
|
||||
|
||||
// Pod Creation Options
|
||||
|
||||
// WithInfraImage sets the infra image for libpod.
|
||||
// An infra image is used for inter-container kernel
|
||||
// namespace sharing within a pod. Typically, an infra
|
||||
// container is lightweight and is there to reap
|
||||
// zombie processes within its pid namespace.
|
||||
func WithInfraImage(img string) PodCreateOption {
|
||||
return func(pod *Pod) error {
|
||||
if pod.valid {
|
||||
return define.ErrPodFinalized
|
||||
}
|
||||
|
||||
pod.config.InfraContainer.InfraImage = img
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithInfraCommand sets the command to
|
||||
// run on pause container start up.
|
||||
func WithInfraCommand(cmd []string) PodCreateOption {
|
||||
return func(pod *Pod) error {
|
||||
if pod.valid {
|
||||
return define.ErrPodFinalized
|
||||
}
|
||||
|
||||
pod.config.InfraContainer.InfraCommand = cmd
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithPodName sets the name of the pod.
|
||||
func WithPodName(name string) PodCreateOption {
|
||||
return func(pod *Pod) error {
|
||||
|
Reference in New Issue
Block a user