Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the support for CRI v1alpha2 #334

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading