Skip to content

Commit

Permalink
features: Fix ociMaxVersion
Browse files Browse the repository at this point in the history
We are vendoring a runtime-spec version that breaks semver. Let's just
hardcode the ociMaxVersion, instead of using the version from the
bindings that reports "1.0.2-dev", that should be interpreted as
something bigger than "1.0.2".

That is not true according to semver, so let's just report "1.0.3-dev"
that is indeed bigger according to semver. We don't expect to change the
runtime-spec vendored version in the 1.1 release.

Signed-off-by: Rodrigo Campos <[email protected]>
  • Loading branch information
rata committed Aug 21, 2023
1 parent 26a98ea commit 9baadd1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions features.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/opencontainers/runc/libcontainer/seccomp"
"github.com/opencontainers/runc/libcontainer/specconv"
"github.com/opencontainers/runc/types/features"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/urfave/cli"
)

Expand All @@ -31,7 +30,12 @@ var featuresCommand = cli.Command{

feat := features.Features{
OCIVersionMin: "1.0.0",
OCIVersionMax: specs.Version,
// We usually use specs.Version here, but the version we are vendoring the
// runtime-spec has a bug regarding the use of semver. To workaround it, we
// just hardcode this in for the 1.1 branch, as we don't expect this to
// change.
// See: https://github.com/opencontainers/runtime-spec/issues/1220
OCIVersionMax: "1.0.3-dev",
Annotations: map[string]string{
features.AnnotationRuncVersion: version,
features.AnnotationRuncCommit: gitCommit,
Expand Down

0 comments on commit 9baadd1

Please sign in to comment.