Skip to content

Commit

Permalink
Set grpc code for unimplemented cri-api methods
Browse files Browse the repository at this point in the history
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
  • Loading branch information
ruiwen-zhao committed Sep 22, 2022
1 parent 462caf1 commit 0f7e258
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pkg/cri/server/container_checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ package server

import (
"context"
"errors"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func (c *criService) CheckpointContainer(ctx context.Context, r *runtime.CheckpointContainerRequest) (res *runtime.CheckpointContainerResponse, err error) {
return nil, errors.New("not implemented")
return nil, status.Errorf(codes.Unimplemented, "method CheckpointContainer not implemented")
}
6 changes: 3 additions & 3 deletions pkg/cri/server/container_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package server

import (
"errors"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func (c *criService) GetContainerEvents(r *runtime.GetEventsRequest, s runtime.RuntimeService_GetContainerEventsServer) error {
return errors.New("not implemented")
return status.Errorf(codes.Unimplemented, "method GetContainerEvents not implemented")
}

0 comments on commit 0f7e258

Please sign in to comment.