From 9262ea47a5d93d44b14f298663982b75ed2e4898 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Mon, 25 Oct 2021 13:13:56 -0700 Subject: Add support for containerd 1.5 "cri.runtimeoptions.v1" moved to "runtimeoptions.v1" and containerd configuration format version 2 is required. Updates #6449 PiperOrigin-RevId: 405474653 --- pkg/shim/service.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pkg/shim/service.go') diff --git a/pkg/shim/service.go b/pkg/shim/service.go index 0980d964e..8e5aea739 100644 --- a/pkg/shim/service.go +++ b/pkg/shim/service.go @@ -49,6 +49,7 @@ import ( "github.com/sirupsen/logrus" "golang.org/x/sys/unix" "gvisor.dev/gvisor/pkg/cleanup" + "gvisor.dev/gvisor/pkg/shim/runtimeoptions/v14" "gvisor.dev/gvisor/pkg/shim/proc" "gvisor.dev/gvisor/pkg/shim/runsc" @@ -344,7 +345,15 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (*ta // A config file in runtime root is not required. path = "" } - case *runtimeoptions.Options: // containerd 1.3.x+ + case *runtimeoptions.Options: // containerd 1.5+ + if o.ConfigPath == "" { + break + } + if o.TypeUrl != optionsType { + return nil, fmt.Errorf("unsupported option type %q", o.TypeUrl) + } + path = o.ConfigPath + case *v14.Options: // containerd 1.4- if o.ConfigPath == "" { break } -- cgit v1.2.3