2016-09-19 07:21:14 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"golang.org/x/net/context"
|
2016-10-20 18:51:38 +00:00
|
|
|
pb "k8s.io/kubernetes/pkg/kubelet/api/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) {
|
|
|
|
|
|
|
|
runtimeVersion, err := s.runtime.Version()
|
|
|
|
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
|
|
|
|
runtimeName := s.runtime.Name()
|
|
|
|
|
|
|
|
return &pb.VersionResponse{
|
|
|
|
Version: &version,
|
|
|
|
RuntimeName: &runtimeName,
|
|
|
|
RuntimeVersion: &runtimeVersion,
|
|
|
|
RuntimeApiVersion: &rav,
|
|
|
|
}, nil
|
|
|
|
}
|