diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/bindings/test/containers_test.go | 11 | ||||
-rw-r--r-- | pkg/domain/infra/abi/play.go | 21 | ||||
-rw-r--r-- | pkg/spec/createconfig.go | 10 |
3 files changed, 30 insertions, 12 deletions
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go index db5be4909..bf2ceab2a 100644 --- a/pkg/bindings/test/containers_test.go +++ b/pkg/bindings/test/containers_test.go @@ -2,7 +2,6 @@ package test_bindings import ( "net/http" - "strconv" "strings" "time" @@ -10,7 +9,6 @@ import ( "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/bindings/containers" "github.com/containers/podman/v2/pkg/specgen" - "github.com/containers/podman/v2/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -182,14 +180,6 @@ var _ = Describe("Podman containers ", func() { }) It("podman remove a paused container by id with force", func() { - // FIXME: Skip on F31 and later - host := utils.GetHostDistributionInfo() - osVer, err := strconv.Atoi(host.Version) - Expect(err).To(BeNil()) - if host.Distribution == "fedora" && osVer >= 31 { - Skip("FIXME: https://github.com/containers/podman/issues/5325") - } - // Removing a paused container with force should work var name = "top" cid, err := bt.RunTopContainer(&name, bindings.PFalse, nil) @@ -280,7 +270,6 @@ var _ = Describe("Podman containers ", func() { }) It("podman wait to pause|unpause condition", func() { - Skip("FIXME: https://github.com/containers/podman/issues/6518") var ( name = "top" exitCode int32 = -1 diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 4ebc37cda..31ad51672 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -144,6 +144,16 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY podOptions = append(podOptions, libpod.WithPodHostNetwork()) } + if podYAML.Spec.HostAliases != nil { + hosts := make([]string, 0, len(podYAML.Spec.HostAliases)) + for _, hostAlias := range podYAML.Spec.HostAliases { + for _, host := range hostAlias.Hostnames { + hosts = append(hosts, host+":"+hostAlias.IP) + } + } + podOptions = append(podOptions, libpod.WithPodHosts(hosts)) + } + nsOptions, err := generate.GetNamespaceOptions(strings.Split(createconfig.DefaultKernelNamespaces, ",")) if err != nil { return nil, err @@ -250,13 +260,22 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY if err := libpod.LabelVolumePath(hostPath.Path); err != nil { return nil, errors.Wrapf(err, "Error giving %s a label", hostPath.Path) } + case v1.HostPathSocket: + st, err := os.Stat(hostPath.Path) + if err != nil { + return nil, errors.Wrapf(err, "Error checking HostPathSocket") + } + if st.Mode()&os.ModeSocket != os.ModeSocket { + return nil, errors.Errorf("Error checking HostPathSocket: path %s is not a socket", hostPath.Path) + } + case v1.HostPathDirectory: case v1.HostPathFile: case v1.HostPathUnset: // do nothing here because we will verify the path exists in validateVolumeHostDir break default: - return nil, errors.Errorf("Directories are the only supported HostPath type") + return nil, errors.Errorf("Invalid HostPath type %v", hostPath.Type) } } 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{} |