Update sandbox API to return target platform

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2023-01-08 14:22:19 -08:00
parent dd22a3a806
commit f318e5630b
12 changed files with 1026 additions and 557 deletions

View File

@@ -20,7 +20,9 @@ package pause
import (
"context"
"runtime"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/pkg/shutdown"
"github.com/containerd/ttrpc"
log "github.com/sirupsen/logrus"
@@ -71,6 +73,17 @@ func (p *pauseService) StartSandbox(ctx context.Context, req *api.StartSandboxRe
return &api.StartSandboxResponse{}, nil
}
func (p *pauseService) Platform(ctx context.Context, req *api.PlatformRequest) (*api.PlatformResponse, error) {
log.Debugf("platform request: %+v", req)
platform := types.Platform{
OS: runtime.GOOS,
Architecture: runtime.GOARCH,
}
return &api.PlatformResponse{Platform: &platform}, nil
}
func (p *pauseService) StopSandbox(ctx context.Context, req *api.StopSandboxRequest) (*api.StopSandboxResponse, error) {
log.Debugf("stop sandbox request: %+v", req)
p.shutdown.Shutdown()