summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_inspect.go1
-rw-r--r--libpod/container_internal.go7
-rw-r--r--libpod/container_internal_linux.go3
-rw-r--r--libpod/define/container_inspect.go2
-rw-r--r--libpod/define/errors.go4
5 files changed, 13 insertions, 4 deletions
diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go
index 437729c2d..835dccd71 100644
--- a/libpod/container_inspect.go
+++ b/libpod/container_inspect.go
@@ -465,6 +465,7 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named
if ctrSpec.Linux.Resources.Pids != nil {
hostConfig.PidsLimit = ctrSpec.Linux.Resources.Pids.Limit
}
+ hostConfig.CgroupConf = ctrSpec.Linux.Resources.Unified
if ctrSpec.Linux.Resources.BlockIO != nil {
if ctrSpec.Linux.Resources.BlockIO.Weight != nil {
hostConfig.BlkioWeight = *ctrSpec.Linux.Resources.BlockIO.Weight
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index f3f11f945..c41d81a2b 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -483,12 +483,13 @@ func (c *Container) setupStorage(ctx context.Context) error {
// Set the default Entrypoint and Command
if containerInfo.Config != nil {
+ // Set CMD in the container to the default configuration only if ENTRYPOINT is not set by the user.
+ if c.config.Entrypoint == nil && c.config.Command == nil {
+ c.config.Command = containerInfo.Config.Config.Cmd
+ }
if c.config.Entrypoint == nil {
c.config.Entrypoint = containerInfo.Config.Config.Entrypoint
}
- if c.config.Command == nil {
- c.config.Command = containerInfo.Config.Config.Cmd
- }
}
artifacts := filepath.Join(c.config.StaticDir, artifactsDir)
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index ea4340e00..31dbee572 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -385,7 +385,8 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
if err != nil {
return nil, errors.Wrapf(err, "Invalid Umask Value")
}
- g.SetProcessUmask(uint32(decVal))
+ umask := uint32(decVal)
+ g.Config.Process.User.Umask = &umask
}
// Add addition groups if c.config.GroupAdd is not empty
diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go
index 8adf3c077..44c3d515b 100644
--- a/libpod/define/container_inspect.go
+++ b/libpod/define/container_inspect.go
@@ -518,6 +518,8 @@ type InspectContainerHostConfig struct {
IOMaximumIOps uint64 `json:"IOMaximumIOps"`
// IOMaximumBandwidth is Windows-only and not presently implemented.
IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"`
+ // CgroupConf is the configuration for cgroup v2.
+ CgroupConf map[string]string `json:"CgroupConf"`
}
// InspectBasicNetworkConfig holds basic configuration information (e.g. IP
diff --git a/libpod/define/errors.go b/libpod/define/errors.go
index 6e372eb5e..f80b1d6e3 100644
--- a/libpod/define/errors.go
+++ b/libpod/define/errors.go
@@ -157,4 +157,8 @@ var (
// ErrImageInUse indicates the requested operation failed because the image was in use
ErrImageInUse = errors.New("image is being used")
+
+ // ErrNetworkOnPodContainer indicates the user wishes to alter network attributes on a container
+ // in a pod. This cannot be done as the infra container has all the network information
+ ErrNetworkOnPodContainer = errors.New("network cannot be configured when it is shared with a pod")
)