Add runtime status commpliant with CRI
Signed-off-by: Jacek J. Łakis <jacek.lakis@intel.com>
This commit is contained in:
parent
920acd2f37
commit
0289858d21
2 changed files with 43 additions and 1 deletions
|
@ -597,5 +597,35 @@ func (s *Server) PortForward(ctx context.Context, req *pb.PortForwardRequest) (*
|
|||
|
||||
// Status returns the status of the runtime
|
||||
func (s *Server) Status(ctx context.Context, req *pb.StatusRequest) (*pb.StatusResponse, error) {
|
||||
return nil, nil
|
||||
|
||||
// Deal with Runtime conditions
|
||||
runtimeReady, err := s.runtime.RuntimeReady()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
networkReady, err := s.runtime.NetworkReady()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Use vendored strings
|
||||
runtimeReadyConditionString := pb.RuntimeReady
|
||||
networkReadyConditionString := pb.NetworkReady
|
||||
|
||||
resp := &pb.StatusResponse{
|
||||
Status: &pb.RuntimeStatus{
|
||||
Conditions: []*pb.RuntimeCondition{
|
||||
&pb.RuntimeCondition{
|
||||
Type: &runtimeReadyConditionString,
|
||||
Status: &runtimeReady,
|
||||
},
|
||||
&pb.RuntimeCondition{
|
||||
Type: &networkReadyConditionString,
|
||||
Status: &networkReady,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue