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 <rodrigoca@microsoft.com>
  • Loading branch information
rata committed Aug 21, 2023
1 parent 26a98ea commit 1affd25
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 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,11 @@ var featuresCommand = cli.Command{

feat := features.Features{
OCIVersionMin: "1.0.0",
OCIVersionMax: specs.Version,
// We usually use specs.Version here, but the runtime-spec version we are vendoring
// 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 1affd25

Please sign in to comment.