aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-04 09:14:15 -0500
committerGitHub <noreply@github.com>2022-02-04 09:14:15 -0500
commit4ad9e0030bc20826f735cf4ec0d5ecc287647218 (patch)
tree7d7bdaea0e8993075ff033f1545d8b8b6eadcffa /pkg
parent337f706f6118f2c91e9906afcdaa233f7cfdbaf9 (diff)
parentcad3eb78b4b17e7edec1fdec9ce8a948ab2819e1 (diff)
downloadpodman-4ad9e0030bc20826f735cf4ec0d5ecc287647218.tar.gz
podman-4ad9e0030bc20826f735cf4ec0d5ecc287647218.tar.bz2
podman-4ad9e0030bc20826f735cf4ec0d5ecc287647218.zip
Merge pull request #13133 from mheon/bump_400_rc4
Bump to v4.0.0-RC4
Diffstat (limited to 'pkg')
-rw-r--r--pkg/machine/ignition.go22
-rw-r--r--pkg/specgen/generate/pod_create.go6
-rw-r--r--pkg/specgenutil/specgen.go8
3 files changed, 29 insertions, 7 deletions
diff --git a/pkg/machine/ignition.go b/pkg/machine/ignition.go
index ca6abd48c..206c9144f 100644
--- a/pkg/machine/ignition.go
+++ b/pkg/machine/ignition.go
@@ -248,6 +248,10 @@ netns="bridge"
machine_enabled=true
`
+ delegateConf := `[Service]
+Delegate=memory pids cpu io
+`
+
// Add a fake systemd service to get the user socket rolling
files = append(files, File{
Node: Node{
@@ -280,6 +284,24 @@ machine_enabled=true
Mode: intToPtr(0744),
},
})
+
+ // Set delegate.conf so cpu,io subsystem is delegated to non-root users as well for cgroupv2
+ // by default
+ files = append(files, File{
+ Node: Node{
+ Group: getNodeGrp("root"),
+ Path: "/etc/systemd/system/user@.service.d/delegate.conf",
+ User: getNodeUsr("root"),
+ },
+ FileEmbedded1: FileEmbedded1{
+ Append: nil,
+ Contents: Resource{
+ Source: encodeDataURLPtr(delegateConf),
+ },
+ Mode: intToPtr(0644),
+ },
+ })
+
// Add a file into linger
files = append(files, File{
Node: Node{
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index 369ebda58..03829e8cf 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -82,7 +82,7 @@ func pullOrBuildInfraImage(p *entities.PodSpec, rt *libpod.Runtime) error {
imageName = rtConfig.Engine.InfraImage
}
- if imageName != config.DefaultInfraImage {
+ if imageName != "" {
_, err := rt.LibimageRuntime().Pull(context.Background(), imageName, config.PullPolicyMissing, nil)
if err != nil {
return err
@@ -278,8 +278,6 @@ func MapSpec(p *specgen.PodSpecGenerator) (*specgen.SpecGenerator, error) {
p.InfraContainerSpec.ConmonPidFile = p.InfraConmonPidFile
}
- if p.InfraImage != config.DefaultInfraImage {
- p.InfraContainerSpec.Image = p.InfraImage
- }
+ p.InfraContainerSpec.Image = p.InfraImage
return p.InfraContainerSpec, nil
}
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go
index 8ca7ce4e6..17699a038 100644
--- a/pkg/specgenutil/specgen.go
+++ b/pkg/specgenutil/specgen.go
@@ -19,6 +19,7 @@ import (
"github.com/containers/podman/v4/pkg/specgen"
systemdDefine "github.com/containers/podman/v4/pkg/systemd/define"
"github.com/containers/podman/v4/pkg/util"
+ "github.com/docker/docker/opts"
"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
@@ -422,11 +423,12 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions
// SHM Size
if c.ShmSize != "" {
- shmSize, err := units.FromHumanSize(c.ShmSize)
- if err != nil {
+ var m opts.MemBytes
+ if err := m.Set(c.ShmSize); err != nil {
return errors.Wrapf(err, "unable to translate --shm-size")
}
- s.ShmSize = &shmSize
+ val := m.Value()
+ s.ShmSize = &val
}
if c.Net != nil {