Bump dependencies to Kubernetes 1.20

This commit is contained in:
xing-yang
2020-12-14 18:01:04 +00:00
parent a9a28d8fc7
commit e22364e1cf
799 changed files with 85231 additions and 28917 deletions

View File

@@ -22,12 +22,12 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"net"
"sync"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"k8s.io/klog"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc"
@@ -219,17 +219,24 @@ func logGRPC(method string, request, reply interface{}, err error) {
Method string
Request interface{}
Response interface{}
Error string
// Error as string, for backward compatibility.
// "" on no error.
Error string
// Full error dump, to be able to parse out full gRPC error code and message separately in a test.
FullError error
}{
Method: method,
Request: request,
Response: reply,
Method: method,
Request: request,
Response: reply,
FullError: err,
}
if err != nil {
logMessage.Error = err.Error()
}
msg, _ := json.Marshal(logMessage)
fmt.Printf("gRPCCall: %s\n", msg)
klog.V(3).Infof("gRPCCall: %s\n", msg)
}
func isAuthenticated(req interface{}, creds *CSICreds) (bool, error) {

View File

@@ -234,6 +234,18 @@ func (m *MockControllerServer) ListVolumes(arg0 context.Context, arg1 *csi.ListV
return ret0, ret1
}
func (m *MockControllerServer) ControllerGetVolume(arg0 context.Context, arg1 *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error) {
ret := m.ctrl.Call(m, "ControllerGetVolume", arg0, arg1)
ret0, _ := ret[0].(*csi.ControllerGetVolumeResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ControllerGetVolume indicates an expected call of ControllerGetVolume
func (mr *MockControllerServerMockRecorder) ControllerGetVolume(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControllerGetVolume", reflect.TypeOf((*MockControllerServer)(nil).ControllerGetVolume), arg0, arg1)
}
// ListVolumes indicates an expected call of ListVolumes
func (mr *MockControllerServerMockRecorder) ListVolumes(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVolumes", reflect.TypeOf((*MockControllerServer)(nil).ListVolumes), arg0, arg1)

View File

@@ -19,7 +19,7 @@ package driver
import (
"net"
"github.com/kubernetes-csi/csi-test/utils"
"github.com/kubernetes-csi/csi-test/v4/utils"
"google.golang.org/grpc"
)
@@ -75,7 +75,7 @@ func (m *MockCSIDriver) Nexus() (*grpc.ClientConn, error) {
}
// Create a client connection
m.conn, err = utils.Connect(m.Address())
m.conn, err = utils.Connect(m.Address(), grpc.WithInsecure())
if err != nil {
return nil, err
}

View File

@@ -28,10 +28,7 @@ import (
)
// Connect address by grpc
func Connect(address string) (*grpc.ClientConn, error) {
dialOptions := []grpc.DialOption{
grpc.WithInsecure(),
}
func Connect(address string, dialOptions ...grpc.DialOption) (*grpc.ClientConn, error) {
u, err := url.Parse(address)
if err == nil && (!u.IsAbs() || u.Scheme == "unix") {
dialOptions = append(dialOptions,