Skip to content

Commit

Permalink
Drop the support for CRI v1alpha2
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AkihiroSuda committed Mar 9, 2024
1 parent 77d8e43 commit 00d31bf
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 42,421 deletions.
5 changes: 0 additions & 5 deletions backend/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
runtimeapi_alpha "k8s.io/cri-api/v1alpha2/pkg/apis/runtime/v1alpha2"
"k8s.io/kubernetes/pkg/kubelet/util"

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

as := core.NewDockerServiceAlpha(s.service)
runtimeapi_alpha.RegisterRuntimeServiceServer(s.server, as)
runtimeapi_alpha.RegisterImageServiceServer(s.server, as)

go func() {
if err := s.server.Serve(l); err != nil {
logrus.Error(err, "Failed to serve connections from cri-dockerd")
Expand Down
2 changes: 0 additions & 2 deletions config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,4 @@ const (

// 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"
)
34 changes: 0 additions & 34 deletions core/docker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import (

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

const (
Expand Down Expand Up @@ -74,12 +73,6 @@ const (
defaultCgroupDriver = "cgroupfs"
)

// v1AlphaCRIService provides the interface necessary for cri.v1alpha2
type v1AlphaCRIService interface {
runtimeapi_alpha.RuntimeServiceServer
runtimeapi_alpha.ImageServiceServer
}

// CRIService includes all methods necessary for a CRI backend.
type CRIService interface {
runtimeapi.RuntimeServiceServer
Expand Down Expand Up @@ -288,17 +281,6 @@ type dockerService struct {
cleanupInfosLock sync.RWMutex
}

type dockerServiceAlpha struct {
ds DockerService

// This handles unimplemented methods unless cri-dockerd overrides them
runtimeapi_alpha.UnimplementedRuntimeServiceServer
}

func NewDockerServiceAlpha(ds DockerService) v1AlphaCRIService {
return &dockerServiceAlpha{ds: ds}
}

// Version returns the runtime name, runtime version and runtime API version
func (ds *dockerService) Version(
_ context.Context,
Expand All @@ -316,22 +298,6 @@ func (ds *dockerService) Version(
}, nil
}

func (ds *dockerService) AlphaVersion(
_ context.Context,
r *runtimeapi.VersionRequest,
) (*runtimeapi_alpha.VersionResponse, error) {
v, err := ds.getDockerVersion()
if err != nil {
return nil, err
}
return &runtimeapi_alpha.VersionResponse{
Version: kubeAPIVersion,
RuntimeName: dockerRuntimeName,
RuntimeVersion: v.Version,
RuntimeApiVersion: config.CRIVersionAlpha,
}, nil
}

// getDockerVersion gets the version information from docker.
func (ds *dockerService) getDockerVersion() (*dockertypes.Version, error) {
res, err := ds.systemInfoCache.Memoize("docker_version", systemInfoCacheMinTTL, func() (interface{}, error) {
Expand Down
Loading

0 comments on commit 00d31bf

Please sign in to comment.