integration/*: extend Runtime.Status response

CRI Runtime Status contains `Info` and it can help us check current
configuration.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2024-02-04 19:15:49 +08:00
parent 401d4b491f
commit ec759f5be4
2 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ type RuntimeService interface {
// UpdateRuntimeConfig updates runtime configuration if specified // UpdateRuntimeConfig updates runtime configuration if specified
UpdateRuntimeConfig(runtimeConfig *runtimeapi.RuntimeConfig, opts ...grpc.CallOption) error UpdateRuntimeConfig(runtimeConfig *runtimeapi.RuntimeConfig, opts ...grpc.CallOption) error
// Status returns the status of the runtime. // Status returns the status of the runtime.
Status(opts ...grpc.CallOption) (*runtimeapi.RuntimeStatus, error) Status(opts ...grpc.CallOption) (*runtimeapi.StatusResponse, error)
// RuntimeConfig returns configuration information of the runtime. // RuntimeConfig returns configuration information of the runtime.
// A couple of notes: // A couple of notes:
// - The RuntimeConfigRequest object is not to be confused with the contents of UpdateRuntimeConfigRequest. // - The RuntimeConfigRequest object is not to be confused with the contents of UpdateRuntimeConfigRequest.

View File

@ -513,12 +513,12 @@ func (r *RuntimeService) UpdateRuntimeConfig(runtimeConfig *runtimeapi.RuntimeCo
} }
// Status returns the status of the runtime. // Status returns the status of the runtime.
func (r *RuntimeService) Status(opts ...grpc.CallOption) (*runtimeapi.RuntimeStatus, error) { func (r *RuntimeService) Status(opts ...grpc.CallOption) (*runtimeapi.StatusResponse, error) {
klog.V(10).Infof("[RuntimeService] Status (timeout=%v)", r.timeout) klog.V(10).Infof("[RuntimeService] Status (timeout=%v)", r.timeout)
ctx, cancel := getContextWithTimeout(r.timeout) ctx, cancel := getContextWithTimeout(r.timeout)
defer cancel() defer cancel()
resp, err := r.runtimeClient.Status(ctx, &runtimeapi.StatusRequest{}, opts...) resp, err := r.runtimeClient.Status(ctx, &runtimeapi.StatusRequest{Verbose: true}, opts...)
if err != nil { if err != nil {
klog.Errorf("Status from runtime service failed: %v", err) klog.Errorf("Status from runtime service failed: %v", err)
return nil, err return nil, err
@ -532,7 +532,7 @@ func (r *RuntimeService) Status(opts ...grpc.CallOption) (*runtimeapi.RuntimeSta
return nil, errors.New(errorMessage) return nil, errors.New(errorMessage)
} }
return resp.Status, nil return resp, nil
} }
// RuntimeConfig returns the CgroupDriver of the runtime. // RuntimeConfig returns the CgroupDriver of the runtime.