podman/libpod
George Joseph 6fa234a5de Pass container hostname to netavark
Passing the hostname allows netavark to include it in DHCP lease
requests which, in an environment where DDNS is used, can cause
DNS entries to be created automatically.

* The current Hostname() function in container.go was updated to
check the new `container_name_as_hostname` option in the
CONTAINERS table of containers.conf.  If set and no hostname
was configured for the container, it causes the hostname to be
set to a version of the container's name with the characters not
valid for a hostname removed.  If not set (the default), the original
behavior of setting the hostname to the short container ID is
preserved.

* Because the Hostname() function can return the host's hostname
if the container isn't running in a private UTS namespace, and we'd
NEVER want to send _that_ in a DHCP request for a container, a new
function NetworkHostname() was added which functions like Hostname()
except that it will return an empty string instead of the host's
hostname if the container is not running in a private UTS namespace.

* networking_common.getNetworkOptions() now uses NetworkHostname()
to set the ContainerHostname member of the NetworkOptions structure.
That member was added to the structure in a corresponding commit in
common/libnetwork/types/network.go.

* Added test to containers_conf_test.go

Signed-off-by: George Joseph <g.devel@wxy78.net>
2025-01-06 07:09:12 -07:00
..
define Fix device limitations in podman-remote update on remote systems 2024-12-09 17:35:56 +01:00
driver Bump Go module to v5 2024-02-08 09:35:39 -05:00
events refact: EventerType and improve consistency 2024-11-25 08:52:53 +00:00
layers Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
linkmode chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
lock Additional potential race condition on os.Readdir 2024-08-12 11:38:02 -04:00
logs bump go to 1.22 2024-09-03 15:14:15 +02:00
plugin libpod: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
shutdown libpod: remove shutdown.Unregister() 2024-09-26 16:20:56 +02:00
boltdb_state.go libpod: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
boltdb_state_internal.go Ignore result of EvalSymlinks on ENOENT 2024-07-11 09:39:56 -04:00
common_test.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container.go Pass container hostname to netavark 2025-01-06 07:09:12 -07:00
container_api.go Configure HealthCheck with `podman update` 2024-11-19 19:44:14 +01:00
container_commit.go api: Error checking before NULL dereference 2024-11-28 14:01:45 +03:00
container_config.go Add --hosts-file flag to container and pod commands 2024-11-24 22:00:34 -05:00
container_copy_common.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_copy_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_copy_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_exec.go Use persist dir for oom file 2024-02-12 09:13:39 -05:00
container_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_graph.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_graph_test.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_inspect.go Add --hosts-file flag to container and pod commands 2024-11-24 22:00:34 -05:00
container_inspect_freebsd.go libpod: fix HostConfig.Devices output from 'podman inspect' on FreeBSD 2024-09-02 11:21:35 +01:00
container_inspect_linux.go Switch to moby/sys/capability 2024-10-01 12:52:18 -07:00
container_internal.go Fix overwriting of LinuxResources structure in the database 2024-12-04 13:16:32 +01:00
container_internal_common.go spec: clamp rlimits without CAP_SYS_RESOURCE 2024-11-27 21:35:00 +01:00
container_internal_freebsd.go libpod: cleanupNetwork() return error 2024-08-09 10:57:24 +02:00
container_internal_linux.go libpod: addHosts() prevent nil deref 2024-11-15 13:39:45 +01:00
container_internal_linux_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_internal_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_log.go libpod: log file use Wait() over event API 2024-11-01 18:53:08 +01:00
container_log_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_log_unsupported.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_path_resolution.go chore: fix function names in comment 2024-04-08 11:36:50 +08:00
container_path_resolution_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_stat_common.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_stat_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_stat_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_top_freebsd.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
container_top_linux.c libpod/container_top_linux.c: fix missing header 2024-06-27 10:50:17 +02:00
container_top_linux.go update golangci-lint to 1.60.1 2024-08-19 11:41:28 +02:00
container_top_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container_validate.go Add ExposedPorts to Inspect's ContainerConfig 2024-10-01 07:54:52 -04:00
diff.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
doc.go document that using libpod package directly is not supported 2022-03-23 19:05:29 +01:00
events.go Merge pull request #24412 from Sativarsainath-26/network-events 2024-11-06 18:33:18 +00:00
healthcheck.go Configure HealthCheck with `podman update` 2024-11-19 19:44:14 +01:00
healthcheck_config.go Configure HealthCheck with `podman update` 2024-11-19 19:44:14 +01:00
healthcheck_linux.go healthcheck: do not leak service on failed stop 2024-10-25 15:27:05 +02:00
healthcheck_nosystemd_linux.go libpod: do not leak systemd hc startup unit timer 2024-06-04 18:03:46 +02:00
healthcheck_unsupported.go libpod: do not leak systemd hc startup unit timer 2024-06-04 18:03:46 +02:00
info.go Merge pull request #24731 from l0rd/additionalimagestores 2024-12-03 14:15:08 +00:00
info_freebsd.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
info_linux.go rootless: drop function ReadMappingsProc 2024-04-10 11:55:35 +02:00
info_test.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
kube.go When generating host volumes for k8s, force to lowercase 2024-12-16 11:22:22 -05:00
mounts_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
networking_common.go Pass container hostname to netavark 2025-01-06 07:09:12 -07:00
networking_freebsd.go use new c/common pasta2 setup logic to fix dns 2024-03-19 12:09:31 +01:00
networking_linux.go libpod: setupNetNS() correctly mount netns 2024-09-20 15:19:22 +02:00
networking_linux_test.go bump go to 1.22 2024-09-03 15:14:15 +02:00
networking_machine.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
networking_pasta_linux.go libpod: use pasta Setup() over Setup2() 2024-10-30 13:35:56 +01:00
networking_slirp4netns.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
oci.go libpod: remove UpdateContainerStatus() 2024-08-16 15:34:16 +02:00
oci_conmon.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
oci_conmon_attach_common.go fix race conditions in start/attach logic 2024-07-12 15:11:34 +02:00
oci_conmon_attach_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
oci_conmon_attach_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
oci_conmon_common.go libpod: hasCurrentUserMapped checks for gid too 2024-10-04 16:17:04 +02:00
oci_conmon_exec_common.go Use persist dir for oom file 2024-02-12 09:13:39 -05:00
oci_conmon_exec_freebsd.go Cease using deprecated runc userlookup 2024-02-02 11:02:43 -05:00
oci_conmon_exec_linux.go Cease using deprecated runc userlookup 2024-02-02 11:02:43 -05:00
oci_conmon_freebsd.go libpod: intermediate mount if UID not mapped into the userns 2024-06-21 18:01:26 +02:00
oci_conmon_linux.go libpod: intermediate mount if UID not mapped into the userns 2024-06-21 18:01:26 +02:00
oci_missing.go libpod: remove UpdateContainerStatus() 2024-08-16 15:34:16 +02:00
oci_util.go libpod: bind ports before network setup 2024-07-30 14:39:08 +02:00
options.go Configure HealthCheck with `podman update` 2024-11-19 19:44:14 +01:00
pod.go podman pod stats: fix race when ctr process exits 2024-07-22 10:30:42 +02:00
pod_api.go Add --hosts-file flag to container and pod commands 2024-11-24 22:00:34 -05:00
pod_internal.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
pod_internal_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
pod_internal_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
pod_status.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
pod_top_freebsd.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
pod_top_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
reset.go libpod: cleanup default cache on system reset 2024-05-29 11:10:55 +02:00
rlimit_int64.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
rlimit_uint64.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
runtime.go libpod API: make wait endpoint better against rm races 2024-10-08 18:03:15 +02:00
runtime_cstorage.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
runtime_ctr.go podman mount: some better error wrapping 2024-09-27 15:15:23 +02:00
runtime_ctr_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
runtime_ctr_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
runtime_freebsd.go Detect unhandled reboots and require user intervention 2024-04-05 10:07:42 -04:00
runtime_img.go libpod: pass down NoPivotRoot to Buildah 2024-11-18 12:41:47 +01:00
runtime_linux.go Detect unhandled reboots and require user intervention 2024-04-05 10:07:42 -04:00
runtime_migrate_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
runtime_migrate_unsupported.go Remove Libpod special-init conditions 2024-01-12 09:19:34 -05:00
runtime_pod.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
runtime_pod_common.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
runtime_pod_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
runtime_pod_linux.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
runtime_pre_go1.20.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
runtime_renumber.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
runtime_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
runtime_volume.go libpod: remove duplicated HasVolume() check 2024-08-15 11:07:27 +02:00
runtime_volume_common.go Set quota on volume root directory, not _data 2024-10-22 08:49:56 -04:00
runtime_worker.go create runtime's worker queue before queuing any job 2024-07-09 11:15:29 +02:00
service.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
sqlite_state.go Fix an improperly ignored error in SQLite 2024-08-27 13:38:40 -04:00
sqlite_state_internal.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
state.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
state_test.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
stats_common.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
stats_freebsd.go Fix some comments 2024-04-13 15:20:19 +08:00
stats_linux.go libpod: report cgroups deleted during Stat() call 2024-10-29 11:16:57 +01:00
storage.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
util.go Include exposed ports in inspect output when net=host 2024-09-27 12:54:24 -04:00
util_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
util_linux.go libpod: fix rootless cgroup path with --cgroup-parent 2024-09-04 05:30:35 +00:00
util_linux_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
volume.go Only stop chowning volumes once they're not empty 2024-05-22 17:47:01 -04:00
volume_inspect.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
volume_internal.go Only stop chowning volumes once they're not empty 2024-05-22 17:47:01 -04:00
volume_internal_common.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
volume_internal_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
volume_internal_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00