Skip to content

Commit 00d31bf

Browse files
committed
Drop the support for CRI v1alpha2
Kubernetes has dropped the support for CRI v1alpha2 in Kubernetes v1.26: kubernetes/kubernetes PR 110618 Kubernetes v1.25, the last release to support v1alpha2, has already reached the EOL: https://kubernetes.io/releases/patch-releases/#non-active-branch-history Fix issue 333 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 77d8e43 commit 00d31bf

File tree

12 files changed

+0
-42421
lines changed

12 files changed

+0
-42421
lines changed

backend/daemon.go

-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"github.com/sirupsen/logrus"
2626
"google.golang.org/grpc"
2727
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
28-
runtimeapi_alpha "k8s.io/cri-api/v1alpha2/pkg/apis/runtime/v1alpha2"
2928
"k8s.io/kubernetes/pkg/kubelet/util"
3029

3130
"github.com/Mirantis/cri-dockerd/core"
@@ -87,10 +86,6 @@ func (s *CriDockerService) Start() error {
8786
runtimeapi.RegisterRuntimeServiceServer(s.server, s.service)
8887
runtimeapi.RegisterImageServiceServer(s.server, s.service)
8988

90-
as := core.NewDockerServiceAlpha(s.service)
91-
runtimeapi_alpha.RegisterRuntimeServiceServer(s.server, as)
92-
runtimeapi_alpha.RegisterImageServiceServer(s.server, as)
93-
9489
go func() {
9590
if err := s.server.Serve(l); err != nil {
9691
logrus.Error(err, "Failed to serve connections from cri-dockerd")

config/constants.go

-2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,4 @@ const (
168168

169169
// CRIVersion is the latest CRI version supported by the CRI plugin.
170170
CRIVersion = "v1"
171-
// CRIVersionAlpha is the alpha version of CRI supported by the CRI plugin.
172-
CRIVersionAlpha = "v1alpha2"
173171
)

core/docker_service.go

-34
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545

4646
v1 "k8s.io/api/core/v1"
4747
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
48-
runtimeapi_alpha "k8s.io/cri-api/v1alpha2/pkg/apis/runtime/v1alpha2"
4948
)
5049

5150
const (
@@ -74,12 +73,6 @@ const (
7473
defaultCgroupDriver = "cgroupfs"
7574
)
7675

77-
// v1AlphaCRIService provides the interface necessary for cri.v1alpha2
78-
type v1AlphaCRIService interface {
79-
runtimeapi_alpha.RuntimeServiceServer
80-
runtimeapi_alpha.ImageServiceServer
81-
}
82-
8376
// CRIService includes all methods necessary for a CRI backend.
8477
type CRIService interface {
8578
runtimeapi.RuntimeServiceServer
@@ -288,17 +281,6 @@ type dockerService struct {
288281
cleanupInfosLock sync.RWMutex
289282
}
290283

291-
type dockerServiceAlpha struct {
292-
ds DockerService
293-
294-
// This handles unimplemented methods unless cri-dockerd overrides them
295-
runtimeapi_alpha.UnimplementedRuntimeServiceServer
296-
}
297-
298-
func NewDockerServiceAlpha(ds DockerService) v1AlphaCRIService {
299-
return &dockerServiceAlpha{ds: ds}
300-
}
301-
302284
// Version returns the runtime name, runtime version and runtime API version
303285
func (ds *dockerService) Version(
304286
_ context.Context,
@@ -316,22 +298,6 @@ func (ds *dockerService) Version(
316298
}, nil
317299
}
318300

319-
func (ds *dockerService) AlphaVersion(
320-
_ context.Context,
321-
r *runtimeapi.VersionRequest,
322-
) (*runtimeapi_alpha.VersionResponse, error) {
323-
v, err := ds.getDockerVersion()
324-
if err != nil {
325-
return nil, err
326-
}
327-
return &runtimeapi_alpha.VersionResponse{
328-
Version: kubeAPIVersion,
329-
RuntimeName: dockerRuntimeName,
330-
RuntimeVersion: v.Version,
331-
RuntimeApiVersion: config.CRIVersionAlpha,
332-
}, nil
333-
}
334-
335301
// getDockerVersion gets the version information from docker.
336302
func (ds *dockerService) getDockerVersion() (*dockertypes.Version, error) {
337303
res, err := ds.systemInfoCache.Memoize("docker_version", systemInfoCacheMinTTL, func() (interface{}, error) {

0 commit comments

Comments
 (0)