From ec759f5be40ee1f530185fedf1042a28bf5ade8f Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Sun, 4 Feb 2024 19:15:49 +0800 Subject: [PATCH] integration/*: extend Runtime.Status response CRI Runtime Status contains `Info` and it can help us check current configuration. Signed-off-by: Wei Fu --- integration/cri-api/pkg/apis/services.go | 2 +- integration/remote/remote_runtime.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/cri-api/pkg/apis/services.go b/integration/cri-api/pkg/apis/services.go index dc9d44f86..a60ffc527 100644 --- a/integration/cri-api/pkg/apis/services.go +++ b/integration/cri-api/pkg/apis/services.go @@ -120,7 +120,7 @@ type RuntimeService interface { // UpdateRuntimeConfig updates runtime configuration if specified UpdateRuntimeConfig(runtimeConfig *runtimeapi.RuntimeConfig, opts ...grpc.CallOption) error // 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. // A couple of notes: // - The RuntimeConfigRequest object is not to be confused with the contents of UpdateRuntimeConfigRequest. diff --git a/integration/remote/remote_runtime.go b/integration/remote/remote_runtime.go index d602381d9..0b3b89597 100644 --- a/integration/remote/remote_runtime.go +++ b/integration/remote/remote_runtime.go @@ -513,12 +513,12 @@ func (r *RuntimeService) UpdateRuntimeConfig(runtimeConfig *runtimeapi.RuntimeCo } // 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) ctx, cancel := getContextWithTimeout(r.timeout) 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 { klog.Errorf("Status from runtime service failed: %v", err) return nil, err @@ -532,7 +532,7 @@ func (r *RuntimeService) Status(opts ...grpc.CallOption) (*runtimeapi.RuntimeSta return nil, errors.New(errorMessage) } - return resp.Status, nil + return resp, nil } // RuntimeConfig returns the CgroupDriver of the runtime.