mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
pod config: add a CreateCommand
field
Add a `CreateCommand` field to the pod config which includes the entire `os.Args` at pod-creation. Similar to the already existing field in a container config, we need this information to properly generate generic systemd unit files for pods. It's a prerequisite to support the `--new` flag for pods. Also add the `CreateCommand` to the pod-inspect data, which can come in handy for debugging, general inspection and certainly for the tests that are added along with the other changes. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -1538,6 +1538,18 @@ func WithPodHostname(hostname string) PodCreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithPodCreateCommand adds the full command plus arguments of the current
|
||||
// process to the pod config.
|
||||
func WithPodCreateCommand() PodCreateOption {
|
||||
return func(pod *Pod) error {
|
||||
if pod.valid {
|
||||
return define.ErrPodFinalized
|
||||
}
|
||||
pod.config.CreateCommand = os.Args
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithPodLabels sets the labels of a pod.
|
||||
func WithPodLabels(labels map[string]string) PodCreateOption {
|
||||
return func(pod *Pod) error {
|
||||
|
Reference in New Issue
Block a user