diff options
author | José Guilherme Vanz <jvanz@jvanz.com> | 2021-06-29 16:39:11 -0300 |
---|---|---|
committer | José Guilherme Vanz <jvanz@jvanz.com> | 2021-07-15 21:27:51 -0300 |
commit | af40dfc2bf614aeb4191916cc2420068696eb776 (patch) | |
tree | f7470681896508a28aa16095908a62709b6539b7 /libpod/runtime_pod_infra_linux.go | |
parent | 12b67aaf62b6e99f94db7ea89dad87f16a9fbd86 (diff) | |
download | podman-af40dfc2bf614aeb4191916cc2420068696eb776.tar.gz podman-af40dfc2bf614aeb4191916cc2420068696eb776.tar.bz2 podman-af40dfc2bf614aeb4191916cc2420068696eb776.zip |
--infra-name command line argument
Adds the new --infra-name command line argument allowing users to define
the name of the infra container
Issue #10794
Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
Diffstat (limited to 'libpod/runtime_pod_infra_linux.go')
-rw-r--r-- | libpod/runtime_pod_infra_linux.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go index 8342352ec..d4f861118 100644 --- a/libpod/runtime_pod_infra_linux.go +++ b/libpod/runtime_pod_infra_linux.go @@ -201,7 +201,11 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm g.AddLinuxSysctl(sysctlKey, sysctlVal) } - containerName := p.ID()[:IDTruncLength] + "-infra" + containerName := p.config.InfraContainer.InfraName + if containerName == "" { + containerName = p.ID()[:IDTruncLength] + "-infra" + } + logrus.Infof("Infra container name %s", containerName) options = append(options, r.WithPod(p)) options = append(options, WithRootFSFromImage(imgID, imgName, rawImageName)) options = append(options, WithName(containerName)) |