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 flexadapter
import (
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@ -47,7 +47,7 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
}
call := cs.flexDriver.NewDriverCall(attachCmd)
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeAttributes())
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeContext())
call.Append(req.GetNodeId())
callStatus, err := call.Run()
@ -57,12 +57,12 @@ func (cs *controllerServer) ControllerPublishVolume(ctx context.Context, req *cs
return nil, status.Error(codes.Internal, err.Error())
}
pvInfo := map[string]string{}
publishContext := map[string]string{}
pvInfo[deviceID] = callStatus.DevicePath
publishContext[deviceID] = callStatus.DevicePath
return &csi.ControllerPublishVolumeResponse{
PublishInfo: pvInfo,
PublishContext: publishContext,
}, nil
}
@ -86,10 +86,5 @@ func (cs *controllerServer) ControllerUnpublishVolume(ctx context.Context, req *
}
func (cs *controllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
for _, cap := range req.VolumeCapabilities {
if cap.GetAccessMode().GetMode() != csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER {
return &csi.ValidateVolumeCapabilitiesResponse{Supported: false, Message: ""}, nil
}
}
return &csi.ValidateVolumeCapabilitiesResponse{Supported: true, Message: ""}, nil
return cs.DefaultControllerServer.ValidateVolumeCapabilities(ctx, req)
}

View File

@ -19,7 +19,7 @@ package flexadapter
import (
"os"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"github.com/kubernetes-csi/drivers/pkg/csi-common"
@ -38,7 +38,7 @@ type flexAdapter struct {
}
var (
version = "0.3.0"
version = "1.0.0-rc2"
)
func New() *flexAdapter {

View File

@ -19,7 +19,7 @@ package flexadapter
import (
"os"
"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@ -53,9 +53,9 @@ func (ns *nodeServer) waitForAttach(req *csi.NodePublishVolumeRequest, fsType st
var dID string
if req.GetPublishInfo() != nil {
if req.GetPublishContext() != nil {
var ok bool
dID, ok = req.GetPublishInfo()[deviceID]
dID, ok = req.GetPublishContext()[deviceID]
if !ok {
return status.Error(codes.InvalidArgument, "Missing device ID")
}
@ -65,7 +65,7 @@ func (ns *nodeServer) waitForAttach(req *csi.NodePublishVolumeRequest, fsType st
call := ns.flexDriver.NewDriverCall(waitForAttachCmd)
call.Append(dID)
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeAttributes())
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeContext())
_, err := call.Run()
if isCmdNotSupportedErr(err) {
@ -116,15 +116,15 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
call.Append(req.GetTargetPath())
if req.GetPublishInfo() != nil {
call.Append(req.GetPublishInfo()[deviceID])
if req.GetPublishContext() != nil {
call.Append(req.GetPublishContext()[deviceID])
}
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeAttributes())
call.AppendSpec(req.GetVolumeId(), fsType, req.GetReadonly(), req.GetVolumeContext())
_, err = call.Run()
if isCmdNotSupportedErr(err) {
mountFlags := req.GetVolumeCapability().GetMount().GetMountFlags()
err := mountDevice(req.VolumeAttributes[deviceID], targetPath, fsType, req.GetReadonly(), mountFlags)
err := mountDevice(req.VolumeContext[deviceID], targetPath, fsType, req.GetReadonly(), mountFlags)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}