summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-31 13:49:03 -0400
committerGitHub <noreply@github.com>2020-08-31 13:49:03 -0400
commit0c076dbce5fcdc3e1994df099db77c7d51a51dec (patch)
tree74d452debff1340f1279d0e08a613c05607af999 /pkg/spec
parent3352e8b0e6bb77344a4470ef86b2d2dc6262a668 (diff)
parent9ec8a60eae8987f06d1971634c438586534d2987 (diff)
downloadpodman-0c076dbce5fcdc3e1994df099db77c7d51a51dec.tar.gz
podman-0c076dbce5fcdc3e1994df099db77c7d51a51dec.tar.bz2
podman-0c076dbce5fcdc3e1994df099db77c7d51a51dec.zip
Merge pull request #7496 from zhangguanzhang/play-kube-handle-hostAliases
handle play kube with pod.spec.hostAliases
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/createconfig.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index e0c875fe9..4887e9262 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -267,6 +267,16 @@ func (c *CreateConfig) getContainerCreateOptions(runtime *libpod.Runtime, pod *l
options = append(options, runtime.WithPod(pod))
}
+ // handle some spec from the InfraContainer when it's a pod
+ if pod != nil && pod.HasInfraContainer() {
+ InfraCtr, err := pod.InfraContainer()
+ if err != nil {
+ return nil, err
+ }
+ // handle the pod.spec.hostAliases
+ options = append(options, libpod.WithHosts(InfraCtr.HostsAdd()))
+ }
+
if len(mounts) != 0 || len(namedVolumes) != 0 {
destinations := []string{}