mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Merge pull request #11011 from baude/initcontainers
implement init containers in podman
This commit is contained in:
@ -1794,6 +1794,21 @@ func WithPidFile(pidFile string) CtrCreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithInitCtrType indicates the container is a initcontainer
|
||||
func WithInitCtrType(containerType string) CtrCreateOption {
|
||||
return func(ctr *Container) error {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
// Make sure the type is valid
|
||||
if containerType == define.OneShotInitContainer || containerType == define.AlwaysInitContainer {
|
||||
ctr.config.InitContainerType = containerType
|
||||
return nil
|
||||
}
|
||||
return errors.Errorf("%s is invalid init container type", containerType)
|
||||
}
|
||||
}
|
||||
|
||||
// Pod Creation Options
|
||||
|
||||
// WithInfraImage sets the infra image for libpod.
|
||||
|
Reference in New Issue
Block a user