Skip to content

Commit ced9b18

Browse files
authored
Merge pull request containerd#9565 from koct9i/fix-return-grpc-code-unavailable-if-not-initialized
fix: return gRPC code "unavailable" if server is not initialized yet
2 parents b23a75b + c191935 commit ced9b18

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/cri/instrument/instrumented_service.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package instrument
1818

1919
import (
2020
"context"
21-
"errors"
2221

2322
"github.com/containerd/containerd/v2/errdefs"
2423
"github.com/containerd/containerd/v2/tracing"
@@ -63,7 +62,7 @@ func (in *instrumentedService) checkInitialized() error {
6362
if in.c.IsInitialized() {
6463
return nil
6564
}
66-
return errors.New("server is not initialized yet")
65+
return errdefs.ToGRPCf(errdefs.ErrUnavailable, "server is not initialized yet")
6766
}
6867

6968
func (in *instrumentedService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (res *runtime.RunPodSandboxResponse, err error) {

0 commit comments

Comments
 (0)