restructure and make lint
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
aa748b62b2
commit
22d434c1e6
13 changed files with 447 additions and 491 deletions
30
server/version.go
Normal file
30
server/version.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
pb "github.com/kubernetes/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// Version returns the runtime name, runtime version and runtime API version
|
||||
func (s *Server) Version(ctx context.Context, req *pb.VersionRequest) (*pb.VersionResponse, error) {
|
||||
version, err := getGPRCVersion()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
runtimeVersion, err := s.runtime.Version()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// taking const address
|
||||
rav := runtimeAPIVersion
|
||||
runtimeName := s.runtime.Name()
|
||||
|
||||
return &pb.VersionResponse{
|
||||
Version: &version,
|
||||
RuntimeName: &runtimeName,
|
||||
RuntimeVersion: &runtimeVersion,
|
||||
RuntimeApiVersion: &rav,
|
||||
}, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue