From 07b5a061bdfe80ea20d3faee9160748ecb54cbbe Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 15 Jun 2018 14:08:12 +0530 Subject: [PATCH] Mock driver: Return probe ready status CSI 0.3.0 introduced probe ready status. This change adds the Ready value in ProbeResponse. --- mock/service/identity.go | 5 ++++- pkg/sanity/identity.go | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mock/service/identity.go b/mock/service/identity.go index c83daea5..77217f67 100644 --- a/mock/service/identity.go +++ b/mock/service/identity.go @@ -1,6 +1,7 @@ package service import ( + "github.com/golang/protobuf/ptypes/wrappers" "golang.org/x/net/context" "github.com/container-storage-interface/spec/lib/go/csi/v0" @@ -23,7 +24,9 @@ func (s *service) Probe( req *csi.ProbeRequest) ( *csi.ProbeResponse, error) { - return &csi.ProbeResponse{}, nil + return &csi.ProbeResponse{ + Ready: &wrappers.BoolValue{Value: true}, + }, nil } func (s *service) GetPluginCapabilities( diff --git a/pkg/sanity/identity.go b/pkg/sanity/identity.go index cb5aad48..4a0be7b7 100644 --- a/pkg/sanity/identity.go +++ b/pkg/sanity/identity.go @@ -79,6 +79,8 @@ var _ = Describe("Probe [Identity Service]", func() { Expect(ok).To(BeTrue()) Expect(serverError.Code() == codes.FailedPrecondition || serverError.Code() == codes.OK).To(BeTrue()) + + Expect(res.GetReady().GetValue()).To(BeTrue()) }) })