summaryrefslogtreecommitdiffhomepage
path: root/pkg/shim/v2
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/shim/v2')
-rw-r--r--pkg/shim/v2/BUILD43
-rw-r--r--pkg/shim/v2/options/BUILD11
-rw-r--r--pkg/shim/v2/options/options_state_autogen.go3
-rw-r--r--pkg/shim/v2/runtimeoptions/BUILD32
-rw-r--r--pkg/shim/v2/runtimeoptions/runtimeoptions.proto25
-rw-r--r--pkg/shim/v2/runtimeoptions/runtimeoptions_state_autogen.go3
-rw-r--r--pkg/shim/v2/runtimeoptions/runtimeoptions_test.go57
-rw-r--r--pkg/shim/v2/v2_linux_state_autogen.go5
-rw-r--r--pkg/shim/v2/v2_state_autogen.go5
9 files changed, 16 insertions, 168 deletions
diff --git a/pkg/shim/v2/BUILD b/pkg/shim/v2/BUILD
deleted file mode 100644
index 7e0a114a0..000000000
--- a/pkg/shim/v2/BUILD
+++ /dev/null
@@ -1,43 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-package(licenses = ["notice"])
-
-go_library(
- name = "v2",
- srcs = [
- "api.go",
- "epoll.go",
- "service.go",
- "service_linux.go",
- ],
- visibility = ["//shim:__subpackages__"],
- deps = [
- "//pkg/shim/runsc",
- "//pkg/shim/v1/proc",
- "//pkg/shim/v1/utils",
- "//pkg/shim/v2/options",
- "//pkg/shim/v2/runtimeoptions",
- "//runsc/specutils",
- "@com_github_burntsushi_toml//:go_default_library",
- "@com_github_containerd_cgroups//:go_default_library",
- "@com_github_containerd_console//:go_default_library",
- "@com_github_containerd_containerd//api/events:go_default_library",
- "@com_github_containerd_containerd//api/types/task:go_default_library",
- "@com_github_containerd_containerd//errdefs:go_default_library",
- "@com_github_containerd_containerd//events:go_default_library",
- "@com_github_containerd_containerd//log:go_default_library",
- "@com_github_containerd_containerd//mount:go_default_library",
- "@com_github_containerd_containerd//namespaces:go_default_library",
- "@com_github_containerd_containerd//pkg/process:go_default_library",
- "@com_github_containerd_containerd//pkg/stdio:go_default_library",
- "@com_github_containerd_containerd//runtime:go_default_library",
- "@com_github_containerd_containerd//runtime/linux/runctypes:go_default_library",
- "@com_github_containerd_containerd//runtime/v2/shim:go_default_library",
- "@com_github_containerd_containerd//runtime/v2/task:go_default_library",
- "@com_github_containerd_containerd//sys/reaper:go_default_library",
- "@com_github_containerd_fifo//:go_default_library",
- "@com_github_containerd_typeurl//:go_default_library",
- "@com_github_gogo_protobuf//types:go_default_library",
- "@org_golang_x_sys//unix:go_default_library",
- ],
-)
diff --git a/pkg/shim/v2/options/BUILD b/pkg/shim/v2/options/BUILD
deleted file mode 100644
index ca212e874..000000000
--- a/pkg/shim/v2/options/BUILD
+++ /dev/null
@@ -1,11 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-package(licenses = ["notice"])
-
-go_library(
- name = "options",
- srcs = [
- "options.go",
- ],
- visibility = ["//:sandbox"],
-)
diff --git a/pkg/shim/v2/options/options_state_autogen.go b/pkg/shim/v2/options/options_state_autogen.go
new file mode 100644
index 000000000..45857f685
--- /dev/null
+++ b/pkg/shim/v2/options/options_state_autogen.go
@@ -0,0 +1,3 @@
+// automatically generated by stateify.
+
+package options
diff --git a/pkg/shim/v2/runtimeoptions/BUILD b/pkg/shim/v2/runtimeoptions/BUILD
deleted file mode 100644
index abb8c3be3..000000000
--- a/pkg/shim/v2/runtimeoptions/BUILD
+++ /dev/null
@@ -1,32 +0,0 @@
-load("//tools:defs.bzl", "go_library", "go_test", "proto_library")
-
-package(licenses = ["notice"])
-
-proto_library(
- name = "api",
- srcs = [
- "runtimeoptions.proto",
- ],
-)
-
-go_library(
- name = "runtimeoptions",
- srcs = [
- "runtimeoptions.go",
- "runtimeoptions_cri.go",
- ],
- visibility = ["//pkg/shim/v2:__pkg__"],
- deps = ["@com_github_gogo_protobuf//proto:go_default_library"],
-)
-
-go_test(
- name = "runtimeoptions_test",
- size = "small",
- srcs = ["runtimeoptions_test.go"],
- library = ":runtimeoptions",
- deps = [
- "@com_github_containerd_containerd//runtime/v1/shim/v1:go_default_library",
- "@com_github_containerd_typeurl//:go_default_library",
- "@com_github_gogo_protobuf//proto:go_default_library",
- ],
-)
diff --git a/pkg/shim/v2/runtimeoptions/runtimeoptions.proto b/pkg/shim/v2/runtimeoptions/runtimeoptions.proto
deleted file mode 100644
index 057032e34..000000000
--- a/pkg/shim/v2/runtimeoptions/runtimeoptions.proto
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2020 The gVisor Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-package cri.runtimeoptions.v1;
-
-// This is a version of the runtimeoptions CRI API that is vendored.
-//
-// Importing the full CRI package is a nightmare.
-message Options {
- string type_url = 1;
- string config_path = 2;
-}
diff --git a/pkg/shim/v2/runtimeoptions/runtimeoptions_state_autogen.go b/pkg/shim/v2/runtimeoptions/runtimeoptions_state_autogen.go
new file mode 100644
index 000000000..f5c883045
--- /dev/null
+++ b/pkg/shim/v2/runtimeoptions/runtimeoptions_state_autogen.go
@@ -0,0 +1,3 @@
+// automatically generated by stateify.
+
+package runtimeoptions
diff --git a/pkg/shim/v2/runtimeoptions/runtimeoptions_test.go b/pkg/shim/v2/runtimeoptions/runtimeoptions_test.go
deleted file mode 100644
index c59a2400e..000000000
--- a/pkg/shim/v2/runtimeoptions/runtimeoptions_test.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2020 The gVisor Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtimeoptions
-
-import (
- "bytes"
- "testing"
-
- shim "github.com/containerd/containerd/runtime/v1/shim/v1"
- "github.com/containerd/typeurl"
- "github.com/gogo/protobuf/proto"
-)
-
-func TestCreateTaskRequest(t *testing.T) {
- // Serialize the top-level message.
- const encodedText = `options: <
- type_url: "cri.runtimeoptions.v1.Options"
- value: "\n\010type_url\022\013config_path"
->`
- got := &shim.CreateTaskRequest{} // Should have raw options.
- if err := proto.UnmarshalText(encodedText, got); err != nil {
- t.Fatalf("unable to unmarshal text: %v", err)
- }
- var textBuffer bytes.Buffer
- if err := proto.MarshalText(&textBuffer, got); err != nil {
- t.Errorf("unable to marshal text: %v", err)
- }
- t.Logf("got: %s", string(textBuffer.Bytes()))
-
- // Check the options.
- wantOptions := &Options{}
- wantOptions.TypeUrl = "type_url"
- wantOptions.ConfigPath = "config_path"
- gotMessage, err := typeurl.UnmarshalAny(got.Options)
- if err != nil {
- t.Fatalf("unable to unmarshal any: %v", err)
- }
- gotOptions, ok := gotMessage.(*Options)
- if !ok {
- t.Fatalf("got %v, want %v", gotMessage, wantOptions)
- }
- if !proto.Equal(gotOptions, wantOptions) {
- t.Fatalf("got %v, want %v", gotOptions, wantOptions)
- }
-}
diff --git a/pkg/shim/v2/v2_linux_state_autogen.go b/pkg/shim/v2/v2_linux_state_autogen.go
new file mode 100644
index 000000000..1023f4d8f
--- /dev/null
+++ b/pkg/shim/v2/v2_linux_state_autogen.go
@@ -0,0 +1,5 @@
+// automatically generated by stateify.
+
+// +build linux
+
+package v2
diff --git a/pkg/shim/v2/v2_state_autogen.go b/pkg/shim/v2/v2_state_autogen.go
new file mode 100644
index 000000000..1023f4d8f
--- /dev/null
+++ b/pkg/shim/v2/v2_state_autogen.go
@@ -0,0 +1,5 @@
+// automatically generated by stateify.
+
+// +build linux
+
+package v2