vendor updates

This commit is contained in:
Serguei Bezverkhi
2018-03-06 17:33:18 -05:00
parent 4b3ebc171b
commit e9033989a0
5854 changed files with 248382 additions and 119809 deletions

View File

@ -17,13 +17,13 @@ limitations under the License.
package cinder
import (
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/golang/glog"
"github.com/kubernetes-csi/drivers/pkg/cinder/openstack"
csicommon "github.com/kubernetes-csi/drivers/pkg/csi-common"
"github.com/pborman/uuid"
"golang.org/x/net/context"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/util"
)
type controllerServer struct {
@ -43,7 +43,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
if req.GetCapacityRange() != nil {
volSizeBytes = int64(req.GetCapacityRange().GetRequiredBytes())
}
volSizeGB := int(volume.RoundUpSize(volSizeBytes, 1024*1024*1024))
volSizeGB := int(util.RoundUpSize(volSizeBytes, 1024*1024*1024))
// Volume Type
volType := req.GetParameters()["type"]

View File

@ -19,7 +19,7 @@ package cinder
import (
"testing"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/kubernetes-csi/drivers/pkg/cinder/openstack"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
@ -49,7 +49,6 @@ func TestCreateVolume(t *testing.T) {
// Fake request
fakeReq := &csi.CreateVolumeRequest{
Version: &version,
Name: fakeVolName,
VolumeCapabilities: nil,
}
@ -82,7 +81,6 @@ func TestDeleteVolume(t *testing.T) {
// Fake request
fakeReq := &csi.DeleteVolumeRequest{
Version: &version,
VolumeId: fakeVolID,
}
@ -117,7 +115,6 @@ func TestControllerPublishVolume(t *testing.T) {
// Fake request
fakeReq := &csi.ControllerPublishVolumeRequest{
Version: &version,
VolumeId: fakeVolID,
NodeId: fakeNodeID,
VolumeCapability: nil,
@ -157,7 +154,6 @@ func TestControllerUnpublishVolume(t *testing.T) {
// Fake request
fakeReq := &csi.ControllerUnpublishVolumeRequest{
Version: &version,
VolumeId: fakeVolID,
NodeId: fakeNodeID,
}

View File

@ -17,7 +17,7 @@ limitations under the License.
package cinder
import (
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/golang/glog"
"github.com/kubernetes-csi/drivers/pkg/cinder/openstack"
@ -42,24 +42,18 @@ const (
)
var (
version = csi.Version{
Minor: 1,
}
version = "0.2.0"
)
func GetSupportedVersions() []*csi.Version {
return []*csi.Version{&version}
}
func NewDriver(nodeID, endpoint string, cloudconfig string) *driver {
glog.Infof("Driver: %v version: %v", driverName, csicommon.GetVersionString(&version))
glog.Infof("Driver: %v version: %v", driverName, version)
d := &driver{}
d.endpoint = endpoint
d.cloudconfig = cloudconfig
csiDriver := csicommon.NewCSIDriver(driverName, &version, GetSupportedVersions(), nodeID)
csiDriver := csicommon.NewCSIDriver(driverName, version, nodeID)
csiDriver.AddControllerServiceCapabilities(
[]csi.ControllerServiceCapability_RPC_Type{
csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,

View File

@ -17,7 +17,7 @@ limitations under the License.
package cinder
import (
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
@ -130,3 +130,11 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
return &csi.NodeUnpublishVolumeResponse{}, nil
}
func (ns *nodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
return &csi.NodeUnstageVolumeResponse{}, nil
}
func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
return &csi.NodeStageVolumeResponse{}, nil
}

View File

@ -19,7 +19,7 @@ package cinder
import (
"testing"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/kubernetes-csi/drivers/pkg/cinder/mount"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
@ -53,9 +53,7 @@ func TestNodeGetId(t *testing.T) {
}
// Fake request
fakeReq := &csi.NodeGetIdRequest{
Version: &version,
}
fakeReq := &csi.NodeGetIdRequest{}
// Invoke NodeGetId
actualRes, err := fakeNs.NodeGetId(fakeCtx, fakeReq)
@ -88,7 +86,6 @@ func TestNodePublishVolume(t *testing.T) {
// Fake request
fakeReq := &csi.NodePublishVolumeRequest{
Version: &version,
VolumeId: fakeVolID,
PublishInfo: map[string]string{"DevicePath": fakeDevicePath},
TargetPath: fakeTargetPath,
@ -126,7 +123,6 @@ func TestNodeUnpublishVolume(t *testing.T) {
// Fake request
fakeReq := &csi.NodeUnpublishVolumeRequest{
Version: &version,
VolumeId: fakeVolID,
TargetPath: fakeTargetPath,
}