Merge pull request #9565 from koct9i/fix-return-grpc-code-unavailable-if-not-initialized
fix: return gRPC code "unavailable" if server is not initialized yet
This commit is contained in:
commit
ced9b18c23
@ -18,7 +18,6 @@ package instrument
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/tracing"
|
||||
@ -63,7 +62,7 @@ func (in *instrumentedService) checkInitialized() error {
|
||||
if in.c.IsInitialized() {
|
||||
return nil
|
||||
}
|
||||
return errors.New("server is not initialized yet")
|
||||
return errdefs.ToGRPCf(errdefs.ErrUnavailable, "server is not initialized yet")
|
||||
}
|
||||
|
||||
func (in *instrumentedService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandboxRequest) (res *runtime.RunPodSandboxResponse, err error) {
|
||||
|
Loading…
Reference in New Issue
Block a user