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

Add struct for unimplemented methods #294

Merged
merged 1 commit into from
Jan 4, 2024
Merged
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
30 changes: 6 additions & 24 deletions core/docker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ func NewDockerService(
}

type dockerService struct {
// This handles unimplemented methods unless cri-dockerd overrides them
runtimeapi.UnimplementedRuntimeServiceServer

client libdocker.DockerClientInterface
os config.OSInterface
podSandboxImage string
Expand Down Expand Up @@ -287,6 +290,9 @@ type dockerService struct {

type dockerServiceAlpha struct {
ds DockerService

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

func NewDockerServiceAlpha(ds DockerService) v1AlphaCRIService {
Expand Down Expand Up @@ -326,30 +332,6 @@ func (ds *dockerService) AlphaVersion(
}, nil
}

func (ds *dockerService) CheckpointContainer(context.Context, *runtimeapi.CheckpointContainerRequest) (*runtimeapi.CheckpointContainerResponse, error) {
return nil, fmt.Errorf("CheckpointContainer is not implemented")
}

func (ds *dockerService) GetContainerEvents(*runtimeapi.GetEventsRequest, runtimeapi.RuntimeService_GetContainerEventsServer) error {
return fmt.Errorf("GetContainerEvents is not implemented")
}

func (ds *dockerService) ListMetricDescriptors(context.Context, *runtimeapi.ListMetricDescriptorsRequest) (*runtimeapi.ListMetricDescriptorsResponse, error) {
return nil, fmt.Errorf("ListMetricDescriptors is not implemented")
}

func (ds *dockerService) ListPodSandboxMetrics(context.Context, *runtimeapi.ListPodSandboxMetricsRequest) (*runtimeapi.ListPodSandboxMetricsResponse, error) {
return nil, fmt.Errorf("ListPodSandboxMetrics is not implemented")
}

func (ds *dockerService) ListPodSandboxStats(context.Context, *runtimeapi.ListPodSandboxStatsRequest) (*runtimeapi.ListPodSandboxStatsResponse, error) {
return nil, fmt.Errorf("ListPodSandboxStats is not implemented")
}

func (ds *dockerService) PodSandboxStats(context.Context, *runtimeapi.PodSandboxStatsRequest) (*runtimeapi.PodSandboxStatsResponse, error) {
return nil, fmt.Errorf("PodSandboxStats is not implemented")
}

// 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
10 changes: 0 additions & 10 deletions core/service_alpha.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ package core

import (
"context"
"fmt"

"github.com/Mirantis/cri-dockerd/config"
"github.com/Mirantis/cri-dockerd/utils"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/cri-api/v1alpha2/pkg/apis/runtime/v1alpha2"
runtimeapi_alpha "k8s.io/cri-api/v1alpha2/pkg/apis/runtime/v1alpha2"
)

Expand Down Expand Up @@ -604,11 +602,3 @@ func (as *dockerServiceAlpha) Version(
}
return nil, err
}

func (as *dockerServiceAlpha) ListPodSandboxStats(context.Context, *v1alpha2.ListPodSandboxStatsRequest) (*v1alpha2.ListPodSandboxStatsResponse, error) {
return nil, fmt.Errorf("ListPodSandboxStats is not implemented")
}

func (ds *dockerServiceAlpha) PodSandboxStats(context.Context, *v1alpha2.PodSandboxStatsRequest) (*v1alpha2.PodSandboxStatsResponse, error) {
return nil, fmt.Errorf("PodSandboxStats is not implemented")
}
Loading