Skip to content

Commit

Permalink
cmd/create, cmd/run: Rely on podman >= 1.6.4 always being present
Browse files Browse the repository at this point in the history
So far the minimum required Podman version was 1.4.0, based on what used
to be available in RHEL 7.  These days, Podman 1.6.4 is old enough to be
in RHEL 7.9.  Hence it's time to bump the baseline.

#1253
  • Loading branch information
debarshiray committed Mar 2, 2023
1 parent de652f4 commit 8e80dd5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
9 changes: 1 addition & 8 deletions src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,7 @@ func createContainer(container, image, release, authFile string, showCommandToEn
devPtsMount = []string{"--mount", "type=devpts,destination=/dev/pts"}
}

logrus.Debug("Checking if 'podman create' supports '--ulimit host'")

var ulimitHost []string

if podman.CheckVersion("1.5.0") {
logrus.Debug("'podman create' supports '--ulimit host'")
ulimitHost = []string{"--ulimit", "host"}
}
ulimitHost := []string{"--ulimit", "host"}

var usernsArg string
if currentUser.Uid == "0" {
Expand Down
18 changes: 0 additions & 18 deletions src/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,24 +604,6 @@ func startContainer(container string) error {
return fmt.Errorf("failed to start container %s", container)
}

logrus.Debug("Checking if 'podman system migrate' supports '--new-runtime'")

if !podman.CheckVersion("1.6.2") {
var builder strings.Builder

fmt.Fprintf(&builder,
"container %s doesn't support cgroups v%d\n",
container,
cgroupsVersion)

fmt.Fprintf(&builder, "Update Podman to version 1.6.2 or newer.\n")

errMsg := builder.String()
return errors.New(errMsg)
}

logrus.Debug("'podman system migrate' supports '--new-runtime'")

ociRuntimeRequired := "runc"
if cgroupsVersion == 2 {
ociRuntimeRequired = "crun"
Expand Down

0 comments on commit 8e80dd5

Please sign in to comment.