diff options
author | Chen Zhiwei <zhiweik@gmail.com> | 2019-08-17 02:42:36 +0000 |
---|---|---|
committer | Chen Zhiwei <zhiweik@gmail.com> | 2019-08-18 03:48:40 +0000 |
commit | 7aefc1ac33ba153f6177e9fe3c4da886de49a9e2 (patch) | |
tree | fdd2f01237c17263ea06655321696ac3f9f754e0 /libpod/runtime_pod_linux.go | |
parent | 8eab96ec3afdc04c02b5ea1c2067e4a36c14c783 (diff) | |
download | podman-7aefc1ac33ba153f6177e9fe3c4da886de49a9e2.tar.gz podman-7aefc1ac33ba153f6177e9fe3c4da886de49a9e2.tar.bz2 podman-7aefc1ac33ba153f6177e9fe3c4da886de49a9e2.zip |
Allow customizing pod hostname
* set hostname in pod yaml file
* set --hostname in pod create command
Signed-off-by: Chen Zhiwei <zhiweik@gmail.com>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r-- | libpod/runtime_pod_linux.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index f38e6e7c1..073c5054d 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -52,6 +52,10 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (_ *Po pod.config.Name = name } + if pod.config.Hostname == "" { + pod.config.Hostname = pod.config.Name + } + // Allocate a lock for the pod lock, err := r.lockManager.AllocateLock() if err != nil { |