summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-11 16:34:08 -0500
committerGitHub <noreply@github.com>2022-02-11 16:34:08 -0500
commitb0a445e3545d66ba449f2e3e81bde3a2c5db4896 (patch)
tree8e17b2501364ff5c3a1f8d5bd2875a3abfa05f03 /cmd/podman
parentc4a9aa7c73e120fc2e246f056fec83ff35854dba (diff)
parent6a3de93513947368bb27d2daf2d85e096bd5fa6b (diff)
downloadpodman-b0a445e3545d66ba449f2e3e81bde3a2c5db4896.tar.gz
podman-b0a445e3545d66ba449f2e3e81bde3a2c5db4896.tar.bz2
podman-b0a445e3545d66ba449f2e3e81bde3a2c5db4896.zip
Merge pull request #13203 from mheon/bump_rc5
Bump to v4.0.0-RC5
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/pods/create.go9
-rw-r--r--cmd/podman/registry/config.go5
2 files changed, 9 insertions, 5 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index 4b32e7bb7..1cd36008e 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -17,6 +17,7 @@ import (
"github.com/containers/podman/v4/cmd/podman/parse"
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/containers/podman/v4/cmd/podman/validate"
+ "github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/domain/entities"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/pkg/specgen"
@@ -52,6 +53,7 @@ var (
podIDFile string
replace bool
share string
+ shareParent bool
)
func init() {
@@ -88,6 +90,9 @@ func init() {
flags.StringVar(&share, shareFlagName, specgen.DefaultKernelNamespaces, "A comma delimited list of kernel namespaces the pod will share")
_ = createCommand.RegisterFlagCompletionFunc(shareFlagName, common.AutocompletePodShareNamespace)
+ shareParentFlagName := "share-parent"
+ flags.BoolVar(&shareParent, shareParentFlagName, true, "Set the pod's cgroup as the cgroup parent for all containers joining the pod")
+
flags.SetNormalizeFunc(aliasNetworkFlag)
}
@@ -147,7 +152,11 @@ func create(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
+ if strings.Contains(share, "cgroup") && shareParent {
+ return errors.Wrapf(define.ErrInvalidArg, "cannot define the pod as the cgroup parent at the same time as joining the infra container's cgroupNS")
+ }
createOptions.Share = strings.Split(share, ",")
+ createOptions.ShareParent = &shareParent
if cmd.Flag("infra-command").Changed {
// Only send content to server side if user changed defaults
cmdIn, err := cmd.Flags().GetString("infra-command")
diff --git a/cmd/podman/registry/config.go b/cmd/podman/registry/config.go
index 15bb7aee0..b5c9b359c 100644
--- a/cmd/podman/registry/config.go
+++ b/cmd/podman/registry/config.go
@@ -81,11 +81,6 @@ func newPodmanConfig() {
mode = entities.TunnelMode
}
- cfg.Network.NetworkConfigDir = cfg.Network.CNIPluginDirs[0]
- if rootless.IsRootless() {
- cfg.Network.NetworkConfigDir = ""
- }
-
podmanOptions = entities.PodmanConfig{Config: cfg, EngineMode: mode}
}