Skip to content

Commit

Permalink
Merge pull request containerd#5619 from mikebrow/cri-add-v1-proxy-alpha
Browse files Browse the repository at this point in the history
[CRI] move up to CRI v1 and support v1alpha in parallel
  • Loading branch information
estesp authored Jul 9, 2021
2 parents 9fa7d15 + d1c1051 commit cf600ab
Show file tree
Hide file tree
Showing 110 changed files with 36,523 additions and 223 deletions.
2 changes: 1 addition & 1 deletion integration/addition_gids_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestAdditionalGids(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions integration/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"io/ioutil"
"testing"

cri "github.com/containerd/containerd/integration/cri-api/pkg/apis"
"github.com/pelletier/go-toml"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
cri "k8s.io/cri-api/pkg/apis"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ImageList holds public image references
Expand Down
2 changes: 1 addition & 1 deletion integration/container_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestContainerLogWithoutTailingNewLine(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/container_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Test to verify for a container ID
Expand Down
2 changes: 1 addition & 1 deletion integration/container_stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestSharedPidMultiProcessContainerStop(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/container_update_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func checkMemoryLimit(t *testing.T, spec *runtimespec.Spec, memLimit int64) {
Expand Down
2 changes: 1 addition & 1 deletion integration/container_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func createRegularFile(basePath, content string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion integration/container_without_image_ref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Test container lifecycle can work without image references.
Expand Down
2 changes: 1 addition & 1 deletion integration/containerd_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Test to test the CRI plugin should see image pulled into containerd directly.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright The containerd 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
http://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.
*/

/*
Copyright 2016 The Kubernetes Authors.
Expand All @@ -14,12 +30,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// this file is from k8s.io/cri-api/pkg/apis only it points to v1 as the runtimeapi not v1alpha

package cri

import (
"time"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// RuntimeVersioner contains methods for runtime name, version and API version.
Expand Down
2 changes: 1 addition & 1 deletion integration/image_load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Test to load an image from tarball.
Expand Down
2 changes: 1 addition & 1 deletion integration/imagefs_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestImageFSInfo(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
"time"

"github.com/containerd/containerd"
cri "github.com/containerd/containerd/integration/cri-api/pkg/apis"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
cri "k8s.io/cri-api/pkg/apis"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/integration/remote"
dialer "github.com/containerd/containerd/integration/util"
Expand Down
2 changes: 1 addition & 1 deletion integration/no_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestRunPodSandboxWithoutMetadata(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/pod_dualstack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestPodDualStack(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/pod_hostname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestPodHostname(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions integration/remote/remote_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import (
"google.golang.org/grpc"
"k8s.io/klog/v2"

internalapi "k8s.io/cri-api/pkg/apis"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
internalapi "github.com/containerd/containerd/integration/cri-api/pkg/apis"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/integration/remote/util"
)
Expand Down
4 changes: 2 additions & 2 deletions integration/remote/remote_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (
"google.golang.org/grpc"
"k8s.io/klog/v2"

internalapi "github.com/containerd/containerd/integration/cri-api/pkg/apis"
"k8s.io/component-base/logs/logreduction"
internalapi "k8s.io/cri-api/pkg/apis"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
utilexec "k8s.io/utils/exec"

"github.com/containerd/containerd/integration/remote/util"
Expand Down
2 changes: 1 addition & 1 deletion integration/remote/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"fmt"
"time"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// maxMsgSize use 16MB as the default message size limit.
Expand Down
2 changes: 1 addition & 1 deletion integration/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Restart test must run sequentially.
Expand Down
2 changes: 1 addition & 1 deletion integration/runtime_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// TODO(chrisfegly): add/update test(s) to allow testing of multiple runtimes at the same time
Expand Down
2 changes: 1 addition & 1 deletion integration/sandbox_clean_remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/sys/unix"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestSandboxRemoveWithoutIPLeakage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/truncindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func genTruncIndex(normalName string) string {
Expand Down
6 changes: 4 additions & 2 deletions pkg/cri/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package constants
const (
// K8sContainerdNamespace is the namespace we use to connect containerd.
K8sContainerdNamespace = "k8s.io"
// CRIVersion is the CRI version supported by the CRI plugin.
CRIVersion = "v1alpha2"
// CRIVersion is the latest CRI version supported by the CRI plugin.
CRIVersion = "v1"
// CRIVersionAlpha is the alpha version of CRI supported by the CRI plugin.
CRIVersionAlpha = "v1alpha2"
)
2 changes: 1 addition & 1 deletion pkg/cri/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func init() {

func initCRIService(ic *plugin.InitContext) (interface{}, error) {
ic.Meta.Platforms = []imagespec.Platform{platforms.DefaultSpec()}
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion}
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion, "CRIVersionAlpha": constants.CRIVersionAlpha}
ctx := ic.Context
pluginConfig := ic.Config.(*criconfig.PluginConfig)
if err := criconfig.ValidatePluginConfig(ctx, pluginConfig); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/io/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/containerd/containerd/cio"
"golang.org/x/net/context"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// AttachOptions specifies how to attach to a container.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/io/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"time"

"github.com/sirupsen/logrus"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

cioutil "github.com/containerd/containerd/pkg/ioutil"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/io/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

cioutil "github.com/containerd/containerd/pkg/ioutil"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// DefaultSandboxCPUshares is default cpu shares for sandbox container.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/pkg/cri/util"
osinterface "github.com/containerd/containerd/pkg/os"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestOrderedMounts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/opts/spec_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/containerd/containerd/oci"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

osinterface "github.com/containerd/containerd/pkg/os"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/pkg/errors"
"golang.org/x/net/context"
"k8s.io/client-go/tools/remotecommand"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

cio "github.com/containerd/containerd/pkg/cri/io"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
selinux "github.com/opencontainers/selinux/go-selinux"
"github.com/pkg/errors"
"golang.org/x/net/context"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

cio "github.com/containerd/containerd/pkg/cri/io"
customopts "github.com/containerd/containerd/pkg/cri/opts"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_create_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
selinux "github.com/opencontainers/selinux/go-selinux"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/pkg/cri/annotations"
"github.com/containerd/containerd/pkg/cri/config"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_create_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/pkg/cap"
"github.com/containerd/containerd/pkg/cri/annotations"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_create_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/containerd/containerd/oci"
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/pkg/cri/config"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_create_other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

imagespec "github.com/opencontainers/image-spec/specs-go/v1"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// checkMount is defined by all tests but not used here
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/container_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/containerd/containerd/pkg/cri/config"
"github.com/containerd/containerd/pkg/cri/constants"
Expand Down
Loading

0 comments on commit cf600ab

Please sign in to comment.