mirror of
https://github.com/containers/podman.git
synced 2025-10-16 10:43:52 +08:00
Add --no-hostname option
Fixes: https://github.com/containers/podman/issues/25002 Also add the ability to inspect containers for UseImageHosts and UseImageHostname. Finally fixed some bugs in handling of --no-hosts for Pods, which I descovered. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -1389,6 +1389,19 @@ func WithUseImageResolvConf() CtrCreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithUseImageHostname tells the container not to bind-mount /etc/hostname in.
|
||||
func WithUseImageHostname() CtrCreateOption {
|
||||
return func(ctr *Container) error {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
|
||||
ctr.config.UseImageHostname = true
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithUseImageHosts tells the container not to bind-mount /etc/hosts in.
|
||||
// This conflicts with WithHosts().
|
||||
func WithUseImageHosts() CtrCreateOption {
|
||||
|
Reference in New Issue
Block a user