Fresh dep ensure

This commit is contained in:
Mike Cronce
2018-11-26 13:23:56 -05:00
parent 93cb8a04d7
commit 407478ab9a
9016 changed files with 551394 additions and 279685 deletions

View File

@ -17,7 +17,7 @@ limitations under the License.
package csicommon
import (
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
@ -45,27 +45,7 @@ func (cs *DefaultControllerServer) ControllerUnpublishVolume(ctx context.Context
}
func (cs *DefaultControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
glog.V(5).Infof("Using default ValidateVolumeCapabilities")
for _, c := range req.GetVolumeCapabilities() {
found := false
for _, c1 := range cs.Driver.vc {
if c1.GetMode() == c.GetAccessMode().GetMode() {
found = true
}
}
if !found {
return &csi.ValidateVolumeCapabilitiesResponse{
Supported: false,
Message: "Driver doesnot support mode:" + c.GetAccessMode().GetMode().String(),
}, status.Error(codes.InvalidArgument, "Driver doesnot support mode:"+c.GetAccessMode().GetMode().String())
}
// TODO: Ignoring mount & block tyeps for now.
}
return &csi.ValidateVolumeCapabilitiesResponse{
Supported: true,
}, nil
return nil, status.Error(codes.Unimplemented, "")
}
func (cs *DefaultControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {

View File

@ -18,11 +18,12 @@ package csicommon
import (
"fmt"
"github.com/golang/glog"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
)
type CSIDriver struct {

View File

@ -19,7 +19,7 @@ package csicommon
import (
"testing"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@ -31,7 +31,7 @@ const (
)
var (
vendorVersion = "0.3.0"
vendorVersion = "1.0.0-rc2"
)
func NewFakeDriver() *CSIDriver {

View File

@ -17,7 +17,7 @@ limitations under the License.
package csicommon
import (
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"

View File

@ -20,7 +20,7 @@ import (
"context"
"testing"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/stretchr/testify/assert"
)

View File

@ -17,7 +17,7 @@ limitations under the License.
package csicommon
import (
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
@ -36,14 +36,6 @@ func (ns *DefaultNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.N
return nil, status.Error(codes.Unimplemented, "")
}
func (ns *DefaultNodeServer) NodeGetId(ctx context.Context, req *csi.NodeGetIdRequest) (*csi.NodeGetIdResponse, error) {
glog.V(5).Infof("Using default NodeGetId")
return &csi.NodeGetIdResponse{
NodeId: ns.Driver.nodeID,
}, nil
}
func (ns *DefaultNodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
glog.V(5).Infof("Using default NodeGetInfo")
@ -67,3 +59,7 @@ func (ns *DefaultNodeServer) NodeGetCapabilities(ctx context.Context, req *csi.N
},
}, nil
}
func (ns *DefaultNodeServer) NodeGetVolumeStats(ctx context.Context, in *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

View File

@ -20,24 +20,12 @@ import (
"context"
"testing"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func TestNodeGetId(t *testing.T) {
d := NewFakeDriver()
ns := NewDefaultNodeServer(d)
// Test valid request
req := csi.NodeGetIdRequest{}
resp, err := ns.NodeGetId(context.Background(), &req)
assert.NoError(t, err)
assert.Equal(t, resp.GetNodeId(), fakeNodeID)
}
func TestNodeGetInfo(t *testing.T) {
d := NewFakeDriver()

View File

@ -24,7 +24,7 @@ import (
"github.com/golang/glog"
"google.golang.org/grpc"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
)
// Defines Non blocking GRPC server interfaces

View File

@ -20,7 +20,7 @@ import (
"fmt"
"strings"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc"