mirror of
https://github.com/containers/podman.git
synced 2025-05-20 16:47:39 +08:00
Merge pull request #25892 from Regis-Caelum/quadlet-pod-hostname
Add HostName to quadlet pod
This commit is contained in:
@ -1005,6 +1005,7 @@ Valid options for `[Pod]` are listed below:
|
|||||||
| DNSSearch=example.com | --dns-search example.com |
|
| DNSSearch=example.com | --dns-search example.com |
|
||||||
| GIDMap=0:10000:10 | --gidmap=0:10000:10 |
|
| GIDMap=0:10000:10 | --gidmap=0:10000:10 |
|
||||||
| GlobalArgs=--log-level=debug | --log-level=debug |
|
| GlobalArgs=--log-level=debug | --log-level=debug |
|
||||||
|
| HostName=name | --hostname=name |
|
||||||
| IP=192.5.0.1 | --ip 192.5.0.1 |
|
| IP=192.5.0.1 | --ip 192.5.0.1 |
|
||||||
| IP6=2001:db8::1 | --ip6 2001:db8::1 |
|
| IP6=2001:db8::1 | --ip6 2001:db8::1 |
|
||||||
| Network=host | --network host |
|
| Network=host | --network host |
|
||||||
@ -1073,6 +1074,15 @@ escaped to allow inclusion of whitespace and other control characters.
|
|||||||
|
|
||||||
This key can be listed multiple times.
|
This key can be listed multiple times.
|
||||||
|
|
||||||
|
### `HostName=`
|
||||||
|
|
||||||
|
Set the pod’s hostname inside all containers.
|
||||||
|
|
||||||
|
The given hostname is also added to the /etc/hosts file using the container’s primary IP address (also see the `--add-host` option).
|
||||||
|
|
||||||
|
Equivalent to the Podman `--hostname` option.
|
||||||
|
This key can be listed multiple times.
|
||||||
|
|
||||||
### `IP=`
|
### `IP=`
|
||||||
|
|
||||||
Specify a static IPv4 address for the pod, for example **10.88.64.128**.
|
Specify a static IPv4 address for the pod, for example **10.88.64.128**.
|
||||||
|
@ -447,6 +447,7 @@ var (
|
|||||||
KeyDNSSearch: true,
|
KeyDNSSearch: true,
|
||||||
KeyGIDMap: true,
|
KeyGIDMap: true,
|
||||||
KeyGlobalArgs: true,
|
KeyGlobalArgs: true,
|
||||||
|
KeyHostName: true,
|
||||||
KeyIP: true,
|
KeyIP: true,
|
||||||
KeyIP6: true,
|
KeyIP6: true,
|
||||||
KeyNetwork: true,
|
KeyNetwork: true,
|
||||||
@ -1722,6 +1723,7 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]*
|
|||||||
KeyDNSOption: "--dns-option",
|
KeyDNSOption: "--dns-option",
|
||||||
KeyDNSSearch: "--dns-search",
|
KeyDNSSearch: "--dns-search",
|
||||||
KeyAddHost: "--add-host",
|
KeyAddHost: "--add-host",
|
||||||
|
KeyHostName: "--hostname",
|
||||||
}
|
}
|
||||||
lookupAndAddAllStrings(podUnit, PodGroup, allStringsKeys, execStartPre)
|
lookupAndAddAllStrings(podUnit, PodGroup, allStringsKeys, execStartPre)
|
||||||
|
|
||||||
|
3
test/e2e/quadlet/hostname.pod
Normal file
3
test/e2e/quadlet/hostname.pod
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Pod]
|
||||||
|
## assert-podman-pre-args "--hostname" "my-host-name"
|
||||||
|
HostName=my-host-name
|
@ -1076,6 +1076,7 @@ BOGUS=foo
|
|||||||
Entry("Pod - DNS Option", "dns-option.pod"),
|
Entry("Pod - DNS Option", "dns-option.pod"),
|
||||||
Entry("Pod - DNS Search", "dns-search.pod"),
|
Entry("Pod - DNS Search", "dns-search.pod"),
|
||||||
Entry("Pod - Host", "host.pod"),
|
Entry("Pod - Host", "host.pod"),
|
||||||
|
Entry("Pod - HostName", "hostname.pod"),
|
||||||
Entry("Pod - IP", "ip.pod"),
|
Entry("Pod - IP", "ip.pod"),
|
||||||
Entry("Pod - Name", "name.pod"),
|
Entry("Pod - Name", "name.pod"),
|
||||||
Entry("Pod - Network", "network.pod"),
|
Entry("Pod - Network", "network.pod"),
|
||||||
|
Reference in New Issue
Block a user