Merge pull request #8276 from Iceber/remove_cri_v1alpha2

Remove CRI v1alpha2 [deprecated since v1.7]
This commit is contained in:
Fu Wei 2023-03-22 13:25:07 +08:00 committed by GitHub
commit 584d13d5cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 142 additions and 16032 deletions

View File

@ -296,7 +296,7 @@ jobs:
shell: powershell shell: powershell
run: | run: |
# Get critctl tool. Used for cri-integration tests # Get critctl tool. Used for cri-integration tests
$CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-windows-amd64.tar.gz" $CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.26.0/crictl-v1.26.0-windows-amd64.tar.gz"
curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz
tar -xvf c:\crictl.tar.gz tar -xvf c:\crictl.tar.gz
mv crictl.exe "${{ github.workspace }}/bin/crictl.exe" # Move crictl somewhere in path mv crictl.exe "${{ github.workspace }}/bin/crictl.exe" # Move crictl somewhere in path

View File

@ -22,12 +22,6 @@ prefixes = [
] ]
generators = ["go", "go-ttrpc"] generators = ["go", "go-ttrpc"]
[[overrides]]
prefixes = [
"github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2",
]
generators = ["go", "go-grpc"]
[[descriptors]] [[descriptors]]
prefix = "github.com/containerd/containerd/runtime/v2/runc/options" prefix = "github.com/containerd/containerd/runtime/v2/runc/options"
target = "runtime/v2/runc/options/next.pb.txt" target = "runtime/v2/runc/options/next.pb.txt"

View File

@ -378,7 +378,7 @@ The deprecated features are shown in the following table:
| Container label `containerd.io/restart.logpath` | containerd v1.5 | containerd v2.0 ✅ | Use `containerd.io/restart.loguri` label | | Container label `containerd.io/restart.logpath` | containerd v1.5 | containerd v2.0 ✅ | Use `containerd.io/restart.loguri` label |
| `cri-containerd-*.tar.gz` release bundles | containerd v1.6 | containerd v2.0 | Use `containerd-*.tar.gz` bundles | | `cri-containerd-*.tar.gz` release bundles | containerd v1.6 | containerd v2.0 | Use `containerd-*.tar.gz` bundles |
| Pulling Schema 1 images (`application/vnd.docker.distribution.manifest.v1+json`) | containerd v1.7 | containerd v2.0 | Use Schema 2 or OCI images | | Pulling Schema 1 images (`application/vnd.docker.distribution.manifest.v1+json`) | containerd v1.7 | containerd v2.0 | Use Schema 2 or OCI images |
| CRI `v1alpha2` | containerd v1.7 | containerd v2.0 | Use CRI `v1` | | CRI `v1alpha2` | containerd v1.7 | containerd v2.0 | Use CRI `v1` |
### Deprecated config properties ### Deprecated config properties
The deprecated properties in [`config.toml`](./docs/cri/config.md) are shown in the following table: The deprecated properties in [`config.toml`](./docs/cri/config.md) are shown in the following table:

View File

@ -159,10 +159,13 @@ container and `rm ID` to remove a container.
$ crictl version $ crictl version
Version: 0.1.0 Version: 0.1.0
RuntimeName: containerd RuntimeName: containerd
RuntimeVersion: 1.0.0-beta.1-186-gdd47a72-TEST RuntimeVersion: v1.7.0
RuntimeApiVersion: v1alpha2 RuntimeApiVersion: v1
``` ```
## Display Status & Configuration Information about Containerd & The CRI Plugin ## Display Status & Configuration Information about Containerd & The CRI Plugin
<details>
<p>
```console ```console
$ crictl info $ crictl info
{ {
@ -182,35 +185,154 @@ $ crictl info
} }
] ]
}, },
"cniconfig": {
"PluginDirs": [
"/opt/cni/bin"
],
"PluginConfDir": "/etc/cni/net.d",
"PluginMaxConfNum": 1,
"Prefix": "eth",
"Networks": []
},
"config": { "config": {
"containerd": { "containerd": {
"snapshotter": "overlayfs", "snapshotter": "overlayfs",
"runtime": "io.containerd.runtime.v1.linux" "defaultRuntimeName": "runc",
"defaultRuntime": {
"runtimeType": "",
"runtimePath": "",
"runtimeEngine": "",
"PodAnnotations": [],
"ContainerAnnotations": [],
"runtimeRoot": "",
"options": {},
"privileged_without_host_devices": false,
"privileged_without_host_devices_all_devices_allowed": false,
"baseRuntimeSpec": "",
"cniConfDir": "",
"cniMaxConfNum": 0,
"snapshotter": "",
"sandboxMode": ""
},
"untrustedWorkloadRuntime": {
"runtimeType": "",
"runtimePath": "",
"runtimeEngine": "",
"PodAnnotations": [],
"ContainerAnnotations": [],
"runtimeRoot": "",
"options": {},
"privileged_without_host_devices": false,
"privileged_without_host_devices_all_devices_allowed": false,
"baseRuntimeSpec": "",
"cniConfDir": "",
"cniMaxConfNum": 0,
"snapshotter": "",
"sandboxMode": ""
},
"runtimes": {
"runc": {
"runtimeType": "io.containerd.runc.v2",
"runtimePath": "",
"runtimeEngine": "",
"PodAnnotations": [],
"ContainerAnnotations": [],
"runtimeRoot": "",
"options": {
"BinaryName": "",
"CriuImagePath": "",
"CriuPath": "",
"CriuWorkPath": "",
"IoGid": 0,
"IoUid": 0,
"NoNewKeyring": false,
"NoPivotRoot": false,
"Root": "",
"ShimCgroup": "",
"SystemdCgroup": false
},
"privileged_without_host_devices": false,
"privileged_without_host_devices_all_devices_allowed": false,
"baseRuntimeSpec": "",
"cniConfDir": "",
"cniMaxConfNum": 0,
"snapshotter": "",
"sandboxMode": "podsandbox"
}
},
"noPivot": false,
"disableSnapshotAnnotations": true,
"discardUnpackedLayers": false,
"ignoreBlockIONotEnabledErrors": false,
"ignoreRdtNotEnabledErrors": false
}, },
"cni": { "cni": {
"binDir": "/opt/cni/bin", "binDir": "/opt/cni/bin",
"confDir": "/etc/cni/net.d" "confDir": "/etc/cni/net.d",
"maxConfNum": 1,
"setupSerially": false,
"confTemplate": "",
"ipPref": ""
}, },
"registry": { "registry": {
"mirrors": { "configPath": "",
"docker.io": { "mirrors": {},
"endpoint": [ "configs": {},
"https://registry-1.docker.io" "auths": {},
] "headers": {}
}
}
}, },
"streamServerPort": "10010", "imageDecryption": {
"sandboxImage": "registry.k8s.io/pause:3.7", "keyModel": "node"
},
"disableTCPService": true,
"streamServerAddress": "127.0.0.1",
"streamServerPort": "0",
"streamIdleTimeout": "4h0m0s",
"enableSelinux": false,
"selinuxCategoryRange": 1024,
"sandboxImage": "registry.k8s.io/pause:3.8",
"statsCollectPeriod": 10, "statsCollectPeriod": 10,
"systemdCgroup": false,
"enableTLSStreaming": false,
"x509KeyPairStreaming": {
"tlsCertFile": "",
"tlsKeyFile": ""
},
"maxContainerLogSize": 16384,
"disableCgroup": false,
"disableApparmor": false,
"restrictOOMScoreAdj": false,
"maxConcurrentDownloads": 3,
"disableProcMount": false,
"unsetSeccompProfile": "",
"tolerateMissingHugetlbController": true,
"disableHugetlbController": true,
"device_ownership_from_security_context": false,
"ignoreImageDefinedVolumes": false,
"netnsMountsUnderStateDir": false,
"enableUnprivilegedPorts": false,
"enableUnprivilegedICMP": false,
"enableCDI": false,
"cdiSpecDirs": [
"/etc/cdi",
"/var/run/cdi"
],
"imagePullProgressTimeout": "1m0s",
"drainExecSyncIOTimeout": "0s",
"containerdRootDir": "/var/lib/containerd", "containerdRootDir": "/var/lib/containerd",
"containerdEndpoint": "unix:///run/containerd/containerd.sock", "containerdEndpoint": "/run/containerd/containerd.sock",
"rootDir": "/var/lib/containerd/io.containerd.grpc.v1.cri", "rootDir": "/var/lib/containerd/io.containerd.grpc.v1.cri",
"stateDir": "/run/containerd/io.containerd.grpc.v1.cri", "stateDir": "/run/containerd/io.containerd.grpc.v1.cri"
}, },
"golang": "go1.10" "golang": "go1.20.2",
"lastCNILoadStatus": "OK",
"lastCNILoadStatus.default": "OK"
} }
``` ```
</p>
</details>
## More Information ## More Information
See [here](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md) See [here](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md)
for information about crictl. for information about crictl.

View File

@ -21,6 +21,4 @@ const (
K8sContainerdNamespace = "k8s.io" K8sContainerdNamespace = "k8s.io"
// CRIVersion is the latest CRI version supported by the CRI plugin. // CRIVersion is the latest CRI version supported by the CRI plugin.
CRIVersion = "v1" CRIVersion = "v1"
// CRIVersionAlpha is the alpha version of CRI supported by the CRI plugin.
CRIVersionAlpha = "v1alpha2"
) )

View File

@ -56,7 +56,7 @@ func init() {
func initCRIService(ic *plugin.InitContext) (interface{}, error) { func initCRIService(ic *plugin.InitContext) (interface{}, error) {
ic.Meta.Platforms = []imagespec.Platform{platforms.DefaultSpec()} ic.Meta.Platforms = []imagespec.Platform{platforms.DefaultSpec()}
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion, "CRIVersionAlpha": constants.CRIVersionAlpha} ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion}
ctx := ic.Context ctx := ic.Context
pluginConfig := ic.Config.(*criconfig.PluginConfig) pluginConfig := ic.Config.(*criconfig.PluginConfig)
if err := criconfig.ValidatePluginConfig(ctx, pluginConfig); err != nil { if err := criconfig.ValidatePluginConfig(ctx, pluginConfig); err != nil {

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,6 @@ import (
"github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/pkg/kmutex"
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/sandbox" "github.com/containerd/containerd/sandbox"
runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"github.com/containerd/go-cni" "github.com/containerd/go-cni"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
@ -348,11 +347,6 @@ func (c *criService) register(s *grpc.Server) error {
instrumented := instrument.NewService(c) instrumented := instrument.NewService(c)
runtime.RegisterRuntimeServiceServer(s, instrumented) runtime.RegisterRuntimeServiceServer(s, instrumented)
runtime.RegisterImageServiceServer(s, instrumented) runtime.RegisterImageServiceServer(s, instrumented)
instrumentedAlpha := instrument.NewAlphaService(c)
runtime_alpha.RegisterRuntimeServiceServer(s, instrumentedAlpha)
runtime_alpha.RegisterImageServiceServer(s, instrumentedAlpha)
return nil return nil
} }

View File

@ -19,7 +19,6 @@ package sbserver
import ( import (
"context" "context"
runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"github.com/containerd/containerd/version" "github.com/containerd/containerd/version"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
@ -42,13 +41,3 @@ func (c *criService) Version(ctx context.Context, r *runtime.VersionRequest) (*r
RuntimeApiVersion: constants.CRIVersion, RuntimeApiVersion: constants.CRIVersion,
}, nil }, nil
} }
// Version returns the runtime name, runtime version and runtime API version.
func (c *criService) AlphaVersion(ctx context.Context, r *runtime_alpha.VersionRequest) (*runtime_alpha.VersionResponse, error) {
return &runtime_alpha.VersionResponse{
Version: kubeAPIVersion,
RuntimeName: containerName,
RuntimeVersion: version.Version,
RuntimeApiVersion: constants.CRIVersionAlpha,
}, nil
}

View File

@ -33,7 +33,6 @@ import (
"github.com/containerd/containerd/pkg/cri/streaming" "github.com/containerd/containerd/pkg/cri/streaming"
"github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/pkg/kmutex"
"github.com/containerd/containerd/plugin" "github.com/containerd/containerd/plugin"
runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
cni "github.com/containerd/go-cni" cni "github.com/containerd/go-cni"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
@ -326,11 +325,6 @@ func (c *criService) register(s *grpc.Server) error {
instrumented := instrument.NewService(c) instrumented := instrument.NewService(c)
runtime.RegisterRuntimeServiceServer(s, instrumented) runtime.RegisterRuntimeServiceServer(s, instrumented)
runtime.RegisterImageServiceServer(s, instrumented) runtime.RegisterImageServiceServer(s, instrumented)
instrumentedAlpha := instrument.NewAlphaService(c)
runtime_alpha.RegisterRuntimeServiceServer(s, instrumentedAlpha)
runtime_alpha.RegisterImageServiceServer(s, instrumentedAlpha)
return nil return nil
} }

View File

@ -19,7 +19,6 @@ package server
import ( import (
"context" "context"
runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"github.com/containerd/containerd/version" "github.com/containerd/containerd/version"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1" runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
@ -42,13 +41,3 @@ func (c *criService) Version(ctx context.Context, r *runtime.VersionRequest) (*r
RuntimeApiVersion: constants.CRIVersion, RuntimeApiVersion: constants.CRIVersion,
}, nil }, nil
} }
// Version returns the runtime name, runtime version and runtime API version.
func (c *criService) AlphaVersion(ctx context.Context, r *runtime_alpha.VersionRequest) (*runtime_alpha.VersionResponse, error) {
return &runtime_alpha.VersionResponse{
Version: kubeAPIVersion,
RuntimeName: containerName,
RuntimeVersion: version.Version,
RuntimeApiVersion: constants.CRIVersionAlpha,
}, nil
}

View File

@ -1,52 +0,0 @@
/*
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.
*/
package util
import (
"github.com/containerd/containerd/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
)
func AlphaReqToV1Req(
alphar protoreflect.ProtoMessage,
v1r interface{ Unmarshal(_ []byte) error },
) error {
p, err := proto.Marshal(alphar)
if err != nil {
return err
}
if err = v1r.Unmarshal(p); err != nil {
return err
}
return nil
}
func V1RespToAlphaResp(
v1res interface{ Marshal() ([]byte, error) },
alphares protoreflect.ProtoMessage,
) error {
p, err := v1res.Marshal()
if err != nil {
return err
}
if err = proto.Unmarshal(p, alphares); err != nil {
return err
}
return nil
}

View File

@ -49,7 +49,7 @@ cat c:\Logs\go-env.txt
go install github.com/jstemmer/go-junit-report@v0.9.1 go install github.com/jstemmer/go-junit-report@v0.9.1
# Get critctl tool. Used for cri-integration tests # Get critctl tool. Used for cri-integration tests
$CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-windows-amd64.tar.gz" $CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.26.0/crictl-v1.26.0-windows-amd64.tar.gz"
curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz
tar -xvf c:\crictl.tar.gz tar -xvf c:\crictl.tar.gz
mv crictl.exe "${userGoBin}\crictl.exe" # Move crictl somewhere in path mv crictl.exe "${userGoBin}\crictl.exe" # Move crictl somewhere in path

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +0,0 @@
/*
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.
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.
*/
package v1alpha2
// This file contains all constants defined in CRI.
// Required runtime condition type.
const (
// RuntimeReady means the runtime is up and ready to accept basic containers.
RuntimeReady = "RuntimeReady"
// NetworkReady means the runtime network is up and ready to accept containers which require network.
NetworkReady = "NetworkReady"
)
// LogStreamType is the type of the stream in CRI container log.
type LogStreamType string
const (
// Stdout is the stream type for stdout.
Stdout LogStreamType = "stdout"
// Stderr is the stream type for stderr.
Stderr LogStreamType = "stderr"
)
// LogTag is the tag of a log line in CRI container log.
// Currently defined log tags:
// * First tag: Partial/Full - P/F.
// The field in the container log format can be extended to include multiple
// tags by using a delimiter, but changes should be rare. If it becomes clear
// that better extensibility is desired, a more extensible format (e.g., json)
// should be adopted as a replacement and/or addition.
type LogTag string
const (
// LogTagPartial means the line is part of multiple lines.
LogTagPartial LogTag = "P"
// LogTagFull means the line is a single full line or the end of multiple lines.
LogTagFull LogTag = "F"
// LogTagDelimiter is the delimiter for different log tags.
LogTagDelimiter = ":"
)