summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/common/create.go7
-rw-r--r--cmd/podman/common/create_opts.go1
-rw-r--r--cmd/podman/containers/create.go12
-rw-r--r--cmd/podman/containers/run.go3
-rw-r--r--cmd/podman/images/pull.go1
-rw-r--r--completions/bash/podman9
-rw-r--r--docs/source/markdown/podman-create.1.md9
-rw-r--r--docs/source/markdown/podman-pull.1.md9
-rw-r--r--docs/source/markdown/podman-run.1.md9
-rw-r--r--go.mod2
-rw-r--r--go.sum7
-rw-r--r--libpod/image/docker_registry_options.go3
-rw-r--r--libpod/image/pull.go2
-rw-r--r--libpod/kube.go18
-rw-r--r--pkg/api/handlers/libpod/images.go12
-rw-r--r--pkg/api/server/register_images.go8
-rw-r--r--pkg/bindings/images/images.go1
-rw-r--r--pkg/domain/entities/images.go2
-rw-r--r--pkg/domain/infra/abi/images.go1
-rw-r--r--test/e2e/generate_kube_test.go32
-rw-r--r--vendor/modules.txt2
21 files changed, 118 insertions, 32 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index d0bc8d466..2b6f9348e 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -323,13 +323,16 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"override-arch", "",
"use `ARCH` instead of the architecture of the machine for choosing images",
)
- // markFlagHidden(createFlags, "override-arch")
createFlags.StringVar(
&cf.OverrideOS,
"override-os", "",
"use `OS` instead of the running OS for choosing images",
)
- // markFlagHidden(createFlags, "override-os")
+ createFlags.StringVar(
+ &cf.OverrideVariant,
+ "override-variant", "",
+ "Use _VARIANT_ instead of the running architecture variant for choosing images",
+ )
createFlags.String(
"pid", "",
"PID namespace to use",
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 16d41988f..1b0e64590 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -65,6 +65,7 @@ type ContainerCLIOpts struct {
OOMScoreAdj int
OverrideArch string
OverrideOS string
+ OverrideVariant string
PID string
PIDsLimit *int64
Pod string
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index 801547033..5e48aa622 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -66,9 +66,6 @@ func createFlags(flags *pflag.FlagSet) {
_ = flags.MarkHidden("env-host")
_ = flags.MarkHidden("http-proxy")
}
- // Not sure we want these exposed yet. If we do, they need to be documented in man pages
- _ = flags.MarkHidden("override-arch")
- _ = flags.MarkHidden("override-os")
}
func init() {
@@ -254,10 +251,11 @@ func pullImage(imageName string) (string, error) {
return "", errors.Wrapf(define.ErrNoSuchImage, "unable to find a name and tag match for %s in repotags", imageName)
}
pullReport, pullErr := registry.ImageEngine().Pull(registry.GetContext(), imageName, entities.ImagePullOptions{
- Authfile: cliVals.Authfile,
- Quiet: cliVals.Quiet,
- OverrideArch: cliVals.OverrideArch,
- OverrideOS: cliVals.OverrideOS,
+ Authfile: cliVals.Authfile,
+ Quiet: cliVals.Quiet,
+ OverrideArch: cliVals.OverrideArch,
+ OverrideOS: cliVals.OverrideOS,
+ OverrideVariant: cliVals.OverrideVariant,
})
if pullErr != nil {
return "", pullErr
diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go
index a84cb6814..34eea14e1 100644
--- a/cmd/podman/containers/run.go
+++ b/cmd/podman/containers/run.go
@@ -70,9 +70,6 @@ func runFlags(flags *pflag.FlagSet) {
_ = flags.MarkHidden("http-proxy")
_ = flags.MarkHidden("preserve-fds")
}
- // Not sure we want these exposed yet. If we do, they need to be documented in man pages
- _ = flags.MarkHidden("override-arch")
- _ = flags.MarkHidden("override-os")
}
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go
index 4deaecbf5..d86f9800c 100644
--- a/cmd/podman/images/pull.go
+++ b/cmd/podman/images/pull.go
@@ -82,6 +82,7 @@ func pullFlags(flags *pflag.FlagSet) {
flags.StringVar(&pullOptions.CredentialsCLI, "creds", "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry")
flags.StringVar(&pullOptions.OverrideArch, "override-arch", "", "Use `ARCH` instead of the architecture of the machine for choosing images")
flags.StringVar(&pullOptions.OverrideOS, "override-os", "", "Use `OS` instead of the running OS for choosing images")
+ flags.StringVar(&pullOptions.OverrideVariant, "override-variant", "", " use VARIANT instead of the running architecture variant for choosing images")
flags.Bool("disable-content-trust", false, "This is a Docker specific option and is a NOOP")
flags.BoolVarP(&pullOptions.Quiet, "quiet", "q", false, "Suppress output information when pulling images")
flags.StringVar(&pullOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)")
diff --git a/completions/bash/podman b/completions/bash/podman
index ca2c93153..3b50af1a9 100644
--- a/completions/bash/podman
+++ b/completions/bash/podman
@@ -1980,12 +1980,16 @@ _podman_manifest_remove() {
_podman_pull() {
local options_with_args="
--authfile
- --creds
--cert-dir
+ --creds
+ --override-arch
+ --override-os
+ --override-variant
"
local boolean_options="
--all-tags
-a
+ --disable-content-trust
--help
-h
--quiet
@@ -2160,6 +2164,9 @@ _podman_container_run() {
--no-healthcheck
--no-hosts
--oom-score-adj
+ --override-arch
+ --override-os
+ --override-variant
--pid
--pids-limit
--pod
diff --git a/docs/source/markdown/podman-create.1.md b/docs/source/markdown/podman-create.1.md
index 2f59f8a09..9049ffb9f 100644
--- a/docs/source/markdown/podman-create.1.md
+++ b/docs/source/markdown/podman-create.1.md
@@ -599,6 +599,15 @@ Whether to disable OOM Killer for the container or not.
Tune the host's OOM preferences for containers (accepts -1000 to 1000)
+**--override-arch**=*ARCH*
+Override the architecture, defaults to hosts, of the image to be pulled. For example, `arm`.
+
+**--override-os**=*OS*
+Override the OS, defaults to hosts, of the image to be pulled. For example, `windows`.
+
+**--override-variant**=*VARIANT*
+Use _VARIANT_ instead of the default architecture variant of the container image. Some images can use multiple variants of the arm architectures, such as arm/v5 and arm/v7.
+
**--pid**=*pid*
Set the PID mode for the container
diff --git a/docs/source/markdown/podman-pull.1.md b/docs/source/markdown/podman-pull.1.md
index 201b10aa6..c75cb18b4 100644
--- a/docs/source/markdown/podman-pull.1.md
+++ b/docs/source/markdown/podman-pull.1.md
@@ -79,12 +79,15 @@ This is a Docker specific option to disable image verification to a Docker
registry and is not supported by Podman. This flag is a NOOP and provided
solely for scripting compatibility.
+**--override-arch**=*ARCH*
+Override the architecture, defaults to hosts, of the image to be pulled. For example, `arm`.
+
**--override-os**=*OS*
-Use OS instead of the running OS for choosing images
+Override the OS, defaults to hosts, of the image to be pulled. For example, `windows`.
-**--override-arch**=*ARCH*
+**--override-variant**=*VARIANT*
-Override the machine's default architecture of the image to be pulled. For example, `arm`.
+Use _VARIANT_ instead of the default architecture variant of the container image. Some images can use multiple variants of the arm architectures, such as arm/v5 and arm/v7.
**--quiet**, **-q**
diff --git a/docs/source/markdown/podman-run.1.md b/docs/source/markdown/podman-run.1.md
index c86090167..1a7b36a5e 100644
--- a/docs/source/markdown/podman-run.1.md
+++ b/docs/source/markdown/podman-run.1.md
@@ -608,6 +608,15 @@ Whether to disable OOM Killer for the container or not.
Tune the host's OOM preferences for containers (accepts values from **-1000** to **1000**).
+**--override-arch**=*ARCH*
+Override the architecture, defaults to hosts, of the image to be pulled. For example, `arm`.
+
+**--override-os**=*OS*
+Override the OS, defaults to hosts, of the image to be pulled. For example, `windows`.
+
+**--override-variant**=*VARIANT*
+Use _VARIANT_ instead of the default architecture variant of the container image. Some images can use multiple variants of the arm architectures, such as arm/v5 and arm/v7.
+
**--pid**=*mode*
Set the PID namespace mode for the container.
diff --git a/go.mod b/go.mod
index 1f12a0f1e..fca4c14f6 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/containernetworking/plugins v0.8.7
github.com/containers/buildah v1.15.1-0.20200813183340-0a8dc1f8064c
github.com/containers/common v0.20.3-0.20200827091701-a550d6a98aa3
- github.com/containers/conmon v2.0.19+incompatible
+ github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.5.2
github.com/containers/psgo v1.5.1
github.com/containers/storage v1.23.2
diff --git a/go.sum b/go.sum
index 4bc7272d9..c4eb0b68a 100644
--- a/go.sum
+++ b/go.sum
@@ -74,8 +74,8 @@ github.com/containers/buildah v1.15.1-0.20200813183340-0a8dc1f8064c/go.mod h1:+I
github.com/containers/common v0.19.0/go.mod h1:+NUHV8V5Kmo260ja9Dxtr8ialrDnK4RNzyeEbSgmLac=
github.com/containers/common v0.20.3-0.20200827091701-a550d6a98aa3 h1:rTSiIMOH3fbCBN+2L8Xr9BJ19AejEIaBQvzkAXZCz/k=
github.com/containers/common v0.20.3-0.20200827091701-a550d6a98aa3/go.mod h1:z5HJtHWU8sopAHO0Od5s9EpVkXPrLIcNszVvN1Fc3fQ=
-github.com/containers/conmon v2.0.19+incompatible h1:1bDVRvHy2MUNTUT/SW6LlHsJHQBTSwXvnKNdcB/a1vQ=
-github.com/containers/conmon v2.0.19+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
+github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg=
+github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/image/v5 v5.5.1/go.mod h1:4PyNYR0nwlGq/ybVJD9hWlhmIsNra4Q8uOQX2s6E2uM=
github.com/containers/image/v5 v5.5.2 h1:fv7FArz0zUnjH0W0l8t90CqWFlFcQrPP6Pug+9dUtVI=
github.com/containers/image/v5 v5.5.2/go.mod h1:4PyNYR0nwlGq/ybVJD9hWlhmIsNra4Q8uOQX2s6E2uM=
@@ -87,7 +87,6 @@ github.com/containers/ocicrypt v1.0.3/go.mod h1:CUBa+8MRNL/VkpxYIpaMtgn1WgXGyvPQ
github.com/containers/psgo v1.5.1 h1:MQNb7FLbXqBdqz6u4lI2QWizVz4RSTzs1+Nk9XT1iVA=
github.com/containers/psgo v1.5.1/go.mod h1:2ubh0SsreMZjSXW1Hif58JrEcFudQyIy9EzPUWfawVU=
github.com/containers/storage v1.20.2/go.mod h1:oOB9Ie8OVPojvoaKWEGSEtHbXUAs+tSyr7RO7ZGteMc=
-github.com/containers/storage v1.23.0 h1:gYyNkBiihC2FvGiHOjOjpnfojYwgxpLVooTUlmD6pxs=
github.com/containers/storage v1.23.0/go.mod h1:I1EIAA7B4OwWRSA0b4yq2AW1wjvvfcY0zLWQuwTa4zw=
github.com/containers/storage v1.23.2 h1:GPZ8PXYezML1gmZ/uFaXQpyps7AH645lmdvvOJwJYNc=
github.com/containers/storage v1.23.2/go.mod h1:AyTMMiE5ANvZJiqvatQgSZ85wAl5yHucY3NDN/kemr4=
@@ -266,7 +265,6 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
-github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I=
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.10.11 h1:K9z59aO18Aywg2b/WSgBaUX99mHy2BES18Cr5lBKZHk=
github.com/klauspost/compress v1.10.11/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
@@ -410,7 +408,6 @@ github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8 h1:2c1EFnZHIPCW8q
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
github.com/seccomp/containers-golang v0.6.0 h1:VWPMMIDr8pAtNjCX0WvLEEK9EQi5lAm4HtJbDtAtFvQ=
github.com/seccomp/containers-golang v0.6.0/go.mod h1:Dd9mONHvW4YdbSzdm23yf2CFw0iqvqLhO0mEFvPIvm4=
-github.com/seccomp/libseccomp-golang v0.9.1 h1:NJjM5DNFOs0s3kYE1WUOr6G8V97sdt46rlXTMfXGWBo=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/seccomp/libseccomp-golang v0.9.2-0.20200616122406-847368b35ebf h1:b0+ZBD3rohnkQ4q5duD1+RyTXTg9yk+qTOPMSQtapO0=
github.com/seccomp/libseccomp-golang v0.9.2-0.20200616122406-847368b35ebf/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
diff --git a/libpod/image/docker_registry_options.go b/libpod/image/docker_registry_options.go
index c434f0259..257b7ae8d 100644
--- a/libpod/image/docker_registry_options.go
+++ b/libpod/image/docker_registry_options.go
@@ -30,6 +30,8 @@ type DockerRegistryOptions struct {
OSChoice string
// If not "", overrides the use of platform.GOARCH when choosing an image or verifying architecture match.
ArchitectureChoice string
+ // If not "", overrides_VARIANT_ instead of the running architecture variant for choosing images.
+ VariantChoice string
// RegistriesConfPath can be used to override the default path of registries.conf.
RegistriesConfPath string
}
@@ -43,6 +45,7 @@ func (o DockerRegistryOptions) GetSystemContext(parent *types.SystemContext, add
DockerArchiveAdditionalTags: additionalDockerArchiveTags,
OSChoice: o.OSChoice,
ArchitectureChoice: o.ArchitectureChoice,
+ VariantChoice: o.VariantChoice,
BigFilesTemporaryDir: parse.GetTempDir(),
}
if parent != nil {
diff --git a/libpod/image/pull.go b/libpod/image/pull.go
index 641698d03..bdcda4016 100644
--- a/libpod/image/pull.go
+++ b/libpod/image/pull.go
@@ -228,6 +228,7 @@ func (ir *Runtime) pullImageFromHeuristicSource(ctx context.Context, inputName s
if dockerOptions != nil {
sc.OSChoice = dockerOptions.OSChoice
sc.ArchitectureChoice = dockerOptions.ArchitectureChoice
+ sc.VariantChoice = dockerOptions.VariantChoice
}
sc.BlobInfoCacheDir = filepath.Join(ir.store.GraphRoot(), "cache")
srcRef, err := alltransports.ParseImageName(inputName)
@@ -260,6 +261,7 @@ func (ir *Runtime) pullImageFromReference(ctx context.Context, srcRef types.Imag
if dockerOptions != nil {
sc.OSChoice = dockerOptions.OSChoice
sc.ArchitectureChoice = dockerOptions.ArchitectureChoice
+ sc.VariantChoice = dockerOptions.VariantChoice
}
goal, err := ir.pullGoalFromImageReference(ctx, srcRef, transports.ImageName(srcRef), sc)
if err != nil {
diff --git a/libpod/kube.go b/libpod/kube.go
index 0068427a5..5f2c9e0fd 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -48,12 +48,22 @@ func (p *Pod) GenerateForKube() (*v1.Pod, []v1.ServicePort, error) {
return nil, servicePorts, errors.Errorf("pod %s only has an infra container", p.ID())
}
+ extraHost := make([]v1.HostAlias, 0)
if p.HasInfraContainer() {
infraContainer, err := p.getInfraContainer()
if err != nil {
return nil, servicePorts, err
}
-
+ for _, host := range infraContainer.config.ContainerNetworkConfig.HostAdd {
+ hostSli := strings.SplitN(host, ":", 2)
+ if len(hostSli) != 2 {
+ return nil, servicePorts, errors.New("invalid hostAdd")
+ }
+ extraHost = append(extraHost, v1.HostAlias{
+ IP: hostSli[1],
+ Hostnames: []string{hostSli[0]},
+ })
+ }
ports, err = ocicniPortMappingToContainerPort(infraContainer.config.PortMappings)
if err != nil {
return nil, servicePorts, err
@@ -61,7 +71,11 @@ func (p *Pod) GenerateForKube() (*v1.Pod, []v1.ServicePort, error) {
servicePorts = containerPortsToServicePorts(ports)
}
pod, err := p.podWithContainers(allContainers, ports)
- return pod, servicePorts, err
+ if err != nil {
+ return nil, servicePorts, err
+ }
+ pod.Spec.HostAliases = extraHost
+ return pod, servicePorts, nil
}
func (p *Pod) getInfraContainer() (*Container, error) {
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 51013acf1..8d3fc4e00 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -338,11 +338,12 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
decoder := r.Context().Value("decoder").(*schema.Decoder)
query := struct {
- Reference string `schema:"reference"`
- OverrideOS string `schema:"overrideOS"`
- OverrideArch string `schema:"overrideArch"`
- TLSVerify bool `schema:"tlsVerify"`
- AllTags bool `schema:"allTags"`
+ Reference string `schema:"reference"`
+ OverrideOS string `schema:"overrideOS"`
+ OverrideArch string `schema:"overrideArch"`
+ OverrideVariant string `schema:"overrideVariant"`
+ TLSVerify bool `schema:"tlsVerify"`
+ AllTags bool `schema:"allTags"`
}{
TLSVerify: true,
}
@@ -393,6 +394,7 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
DockerRegistryCreds: authConf,
OSChoice: query.OverrideOS,
ArchitectureChoice: query.OverrideArch,
+ VariantChoice: query.OverrideVariant,
}
if _, found := r.URL.Query()["tlsVerify"]; found {
dockerRegistryOptions.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!query.TLSVerify)
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index 748e3fb11..64258a073 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -905,12 +905,16 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: "username:password for the registry"
// type: string
// - in: query
+ // name: overrideArch
+ // description: Pull image for the specified architecture.
+ // type: string
+ // - in: query
// name: overrideOS
// description: Pull image for the specified operating system.
// type: string
// - in: query
- // name: overrideArch
- // description: Pull image for the specified architecture.
+ // name: overrideVariant
+ // description: Pull image for the specified variant.
// type: string
// - in: query
// name: tlsVerify
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index 12d1a9ce9..9f6e78b79 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -365,6 +365,7 @@ func Pull(ctx context.Context, rawImage string, options entities.ImagePullOption
params.Set("reference", rawImage)
params.Set("overrideArch", options.OverrideArch)
params.Set("overrideOS", options.OverrideOS)
+ params.Set("overrideVariant", options.OverrideVariant)
if options.SkipTLSVerify != types.OptionalBoolUndefined {
// Note: we have to verify if skipped is false.
verifyTLS := bool(options.SkipTLSVerify == types.OptionalBoolFalse)
diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go
index cb970b09a..3a12a4e22 100644
--- a/pkg/domain/entities/images.go
+++ b/pkg/domain/entities/images.go
@@ -137,6 +137,8 @@ type ImagePullOptions struct {
// OverrideOS will overwrite the local operating system (OS) for image
// pulls.
OverrideOS string
+ // OverrideVariant will overwrite the local variant for image pulls.
+ OverrideVariant string
// Quiet can be specified to suppress pull progress when pulling. Ignored
// for remote calls.
Quiet bool
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 70d740bb5..6b94ca9c0 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -251,6 +251,7 @@ func (ir *ImageEngine) Pull(ctx context.Context, rawImage string, options entiti
DockerCertPath: options.CertDir,
OSChoice: options.OverrideOS,
ArchitectureChoice: options.OverrideArch,
+ VariantChoice: options.OverrideVariant,
DockerInsecureSkipTLSVerify: options.SkipTLSVerify,
}
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index 1ec8d51c1..3c3fb5a4d 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -151,6 +151,38 @@ var _ = Describe("Podman generate kube", func() {
Expect(numContainers).To(Equal(1))
})
+ It("podman generate kube on pod with hostAliases", func() {
+ podName := "testHost"
+ testIP := "127.0.0.1"
+ podSession := podmanTest.Podman([]string{"pod", "create", "--name", podName,
+ "--add-host", "test1.podman.io" + ":" + testIP,
+ "--add-host", "test2.podman.io" + ":" + testIP,
+ })
+ podSession.WaitWithDefaultTimeout()
+ Expect(podSession.ExitCode()).To(Equal(0))
+
+ ctr1Name := "ctr1"
+ ctr1Session := podmanTest.Podman([]string{"create", "--name", ctr1Name, "--pod", podName, ALPINE, "top"})
+ ctr1Session.WaitWithDefaultTimeout()
+ Expect(ctr1Session.ExitCode()).To(Equal(0))
+
+ ctr2Name := "ctr2"
+ ctr2Session := podmanTest.Podman([]string{"create", "--name", ctr2Name, "--pod", podName, ALPINE, "top"})
+ ctr2Session.WaitWithDefaultTimeout()
+ Expect(ctr2Session.ExitCode()).To(Equal(0))
+
+ kube := podmanTest.Podman([]string{"generate", "kube", podName})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube.ExitCode()).To(Equal(0))
+
+ pod := new(v1.Pod)
+ err := yaml.Unmarshal(kube.Out.Contents(), pod)
+ Expect(err).To(BeNil())
+ Expect(len(pod.Spec.HostAliases)).To(Equal(2))
+ Expect(pod.Spec.HostAliases[0].IP).To(Equal(testIP))
+ Expect(pod.Spec.HostAliases[1].IP).To(Equal(testIP))
+ })
+
It("podman generate service kube on pod", func() {
_, rc, _ := podmanTest.CreatePod("toppod")
Expect(rc).To(Equal(0))
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 5490f3711..177d975c8 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -95,7 +95,7 @@ github.com/containers/common/pkg/retry
github.com/containers/common/pkg/seccomp
github.com/containers/common/pkg/sysinfo
github.com/containers/common/version
-# github.com/containers/conmon v2.0.19+incompatible
+# github.com/containers/conmon v2.0.20+incompatible
github.com/containers/conmon/runner/config
# github.com/containers/image/v5 v5.5.2
github.com/containers/image/v5/copy