2016-09-19 07:21:14 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"golang.org/x/net/context"
|
2017-08-04 11:13:19 +00:00
|
|
|
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
2016-09-19 07:21:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Version returns the runtime name, runtime version and runtime API version
|
|
|
|
func (s *Server) Version(ctx context.Context, req *pb.VersionRequest) (*pb.VersionResponse, error) {
|
|
|
|
|
2017-07-17 12:25:32 +00:00
|
|
|
runtimeVersion, err := s.Runtime().Version()
|
2016-09-19 07:21:14 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2016-10-20 18:51:38 +00:00
|
|
|
// TODO: Track upstream code. For now it expects 0.1.0
|
2016-11-08 16:38:39 +00:00
|
|
|
version := "0.1.0"
|
2016-10-20 18:51:38 +00:00
|
|
|
|
2016-09-19 07:21:14 +00:00
|
|
|
// taking const address
|
|
|
|
rav := runtimeAPIVersion
|
2017-07-17 12:25:32 +00:00
|
|
|
runtimeName := s.Runtime().Name()
|
2016-09-19 07:21:14 +00:00
|
|
|
|
|
|
|
return &pb.VersionResponse{
|
2017-02-03 14:41:28 +00:00
|
|
|
Version: version,
|
|
|
|
RuntimeName: runtimeName,
|
|
|
|
RuntimeVersion: runtimeVersion,
|
|
|
|
RuntimeApiVersion: rav,
|
2016-09-19 07:21:14 +00:00
|
|
|
}, nil
|
|
|
|
}
|