From 1affd2503b8253ee3ec89f7b2c37f600d7818847 Mon Sep 17 00:00:00 2001 From: Rodrigo Campos Date: Mon, 21 Aug 2023 17:10:34 +0200 Subject: [PATCH] features: Fix ociMaxVersion 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 --- features.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/features.go b/features.go index c9cd15cd09d..52f4e15fae2 100644 --- a/features.go +++ b/features.go @@ -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" ) @@ -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,