Skip to content

Commit

Permalink
Merge development branch into master for v0.10.2 release (#358)
Browse files Browse the repository at this point in the history
* Adding First set of Unit Test files for VRO

* ReadMe and Configuration file for VRO test Automation

*  format test files, correct spacing

* NGC Automation for OpenSDS adapter

* hostpath type change for iscsi dir (#10)

* vendor changes update

* Fix for list snapshot issue

* add only snapshots whose status is available to the list

*  Fix for 341 342 309

* [CSI] Update version of k8s csi container images  (#333)

* Update version of k8s csi image (#7)

* csi image version update for file plugin deployment

Co-authored-by: Erik <lynheell@gmail.com>
Co-authored-by: Ashit Kumar <akopensrc@gmail.com>

* [CSI] Support for multiple initiator infos (#335)

* Initiator fix

* Update vendor

Co-authored-by: Erik <lynheell@gmail.com>
Co-authored-by: Ashit Kumar <akopensrc@gmail.com>

* [CSI] Removal of host devices during volume detach (#336)

* remove host device while unstage

* Fix sg_scan not found issue (#6)

Co-authored-by: liuqing <liuqinguestc@163.com>

* Update csi/plugins/block/volume.go

Co-Authored-By: Ashit Kumar <akopensrc@gmail.com>

Co-authored-by: zengyingzhe <52645009+zengyingzhe@users.noreply.github.com>
Co-authored-by: Erik <lynheell@gmail.com>
Co-authored-by: liuqing <liuqinguestc@163.com>
Co-authored-by: Ashit Kumar <akopensrc@gmail.com>

*  Declaring constants for unit tests

* DatastoreServiceImpl create method Unit testing (#350)

* 	modified:   pom.xml
	new file:   src/test/java/service/impl/DatastoreTest.java

* 	renamed:    src/test/java/service/impl/DatastoreTest.java -> src/test/java/org/opensds/vmware/ngc/service/impl/DatastoreTest.java

* 	modified:   src/test/java/org/opensds/vmware/ngc/service/impl/DatastoreTest.java

Co-authored-by: Ashit Kumar <akopensrc@gmail.com>

* Delete Gopkg.lock

* Revert "Delete Gopkg.lock"

This reverts commit e2d8d3e.

* syncing with dec

*  updating default test config values

*  updating default test config values

* Conflict resolution

* vendor update based on v0.10.0 (#364)

Co-authored-by: Najmudheen <45681499+NajmudheenCT@users.noreply.github.com>

Co-authored-by: Najmudheen <45681499+NajmudheenCT@users.noreply.github.com>
Co-authored-by: Ashit Kumar <akopensrc@gmail.com>
Co-authored-by: Erik <lynheell@gmail.com>
Co-authored-by: zengyingzhe <52645009+zengyingzhe@users.noreply.github.com>
Co-authored-by: liuqing <liuqinguestc@163.com>
Co-authored-by: soumiksgithub <soumik.ghosh4@wipro.com>
Co-authored-by: Sanil Kumar <skdsanil@gmail.com>
  • Loading branch information
8 people authored Feb 28, 2020
1 parent ca42166 commit 4299903
Show file tree
Hide file tree
Showing 43 changed files with 498 additions and 108 deletions.
13 changes: 7 additions & 6 deletions cindercompatibleapi/converter/volume.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -447,18 +447,19 @@ func InitializeConnectionReq(initializeConnectionReq *InitializeConnectionReqSpe
continue
}

portName, err := volDriver.GetInitiatorInfo()
portNameList, err := volDriver.GetInitiatorInfo()
if err != nil {
glog.Errorf("cannot get initiator for driver volume type %s, err: %v", volDriverType, err)
continue
}

initiator := &model.Initiator{
PortName: portName,
Protocol: volDriverType,
for _, portName := range portNameList {
initiator := &model.Initiator{
PortName: portName,
Protocol: volDriverType,
}
initiators = append(initiators, initiator)
}

initiators = append(initiators, initiator)
}

if len(initiators) == 0 {
Expand Down
1 change: 1 addition & 0 deletions csi/cmd/block/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ COPY nvme-cli-1.8.1 /nvme-cli-1.8.1
RUN apt-get update && \
apt-get -y install open-iscsi \
sysfsutils \
sg3-utils \
kmod \
ceph-common \
nfs-common \
Expand Down
16 changes: 10 additions & 6 deletions csi/common/node.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,22 @@ func NodeGetInfo(
continue
}

portName, err := volDriver.GetInitiatorInfo()
portNameList, err := volDriver.GetInitiatorInfo()
if err != nil {
glog.Errorf("cannot get initiator for driver volume type %s, err: %v", volDriverType, err)
continue
}

initiator := &model.Initiator{
PortName: portName,
Protocol: volDriverType,
}
for _, portName := range portNameList {
if portName != " " {
initiator := &model.Initiator{
PortName: portName,
Protocol: volDriverType,
}

initiators = append(initiators, initiator)
initiators = append(initiators, initiator)
}
}
}

if len(initiators) == 0 {
Expand Down
4 changes: 2 additions & 2 deletions csi/deploy/kubernetes/block/csi-attacher-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-attacher-block
containers:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.1.1
image: quay.io/k8scsi/csi-attacher:v1.2.1
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -144,7 +144,7 @@ spec:
- name: iscsi-dir
hostPath:
path: /etc/iscsi/
type: Directory
type: DirectoryOrCreate
- name: ceph-dir
hostPath:
path: /etc/ceph/
Expand Down
6 changes: 3 additions & 3 deletions csi/deploy/kubernetes/block/csi-nodeplugin-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
hostNetwork: true
containers:
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
Expand Down Expand Up @@ -155,7 +155,7 @@ spec:
- name: iscsi-dir
hostPath:
path: /etc/iscsi/
type: Directory
type: DirectoryOrCreate
- name: ceph-dir
hostPath:
path: /etc/ceph/
Expand All @@ -171,4 +171,4 @@ spec:
- name: hosts
hostPath:
path: /etc
type: Directory
type: Directory
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-provisioner-block
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.1.0
image: quay.io/k8scsi/csi-provisioner:v1.4.0
args:
- "--provisioner=csi-opensdsplugin-block"
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -123,4 +123,4 @@ spec:
- name: certificate-path
hostPath:
path: /opt/opensds-security
type: DirectoryOrCreate
type: DirectoryOrCreate
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-snapshotter-block
containers:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.1.0
image: quay.io/k8scsi/csi-snapshotter:v1.2.2
args:
- "--snapshotter=csi-opensdsplugin-block"
- "--csi-address=$(ADDRESS)"
Expand Down
4 changes: 2 additions & 2 deletions csi/deploy/kubernetes/file/csi-attacher-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-attacher-file
containers:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.1.1
image: quay.io/k8scsi/csi-attacher:v1.2.1
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -144,7 +144,7 @@ spec:
- name: iscsi-dir
hostPath:
path: /etc/iscsi/
type: Directory
type: DirectoryOrCreate
- name: ceph-dir
hostPath:
path: /etc/ceph/
Expand Down
6 changes: 3 additions & 3 deletions csi/deploy/kubernetes/file/csi-nodeplugin-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
hostNetwork: true
containers:
- name: node-driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
Expand Down Expand Up @@ -155,7 +155,7 @@ spec:
- name: iscsi-dir
hostPath:
path: /etc/iscsi/
type: Directory
type: DirectoryOrCreate
- name: ceph-dir
hostPath:
path: /etc/ceph/
Expand All @@ -171,4 +171,4 @@ spec:
- name: hosts
hostPath:
path: /etc
type: Directory
type: Directory
4 changes: 2 additions & 2 deletions csi/deploy/kubernetes/file/csi-provisioner-opensdsplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-provisioner-file
containers:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.1.0
image: quay.io/k8scsi/csi-provisioner:v1.4.0
args:
- "--provisioner=csi-opensdsplugin-file"
- "--csi-address=$(ADDRESS)"
Expand Down Expand Up @@ -123,4 +123,4 @@ spec:
- name: certificate-path
hostPath:
path: /opt/opensds-security
type: DirectoryOrCreate
type: DirectoryOrCreate
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
serviceAccount: csi-snapshotter-file
containers:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.1.0
image: quay.io/k8scsi/csi-snapshotter:v1.2.2
args:
- "--snapshotter=csi-opensdsplugin-file"
- "--csi-address=$(ADDRESS)"
Expand Down
25 changes: 19 additions & 6 deletions csi/plugins/block/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"github.com/golang/glog"
"github.com/opensds/nbp/csi/common"
"github.com/opensds/nbp/csi/util"
nbputil "github.com/opensds/nbp/util"
"github.com/opensds/opensds/client"
nbputil "github.com/opensds/nbp/util"
"github.com/opensds/opensds/contrib/connector"
"github.com/opensds/opensds/pkg/model"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -263,9 +263,9 @@ func (v *Volume) ControllerPublishVolume(req *csi.ControllerPublishVolumeRequest

var protocol = strings.ToLower(pool.Extras.IOConnectivity.AccessProtocol)
attachReq := &model.VolumeAttachmentSpec{
VolumeId: req.VolumeId,
HostId: req.NodeId,
AttachMode: attachMode,
VolumeId: req.VolumeId,
HostId: req.NodeId,
AttachMode: attachMode,
ConnectionInfo: model.ConnectionInfo{
DriverVolumeType: protocol,
},
Expand Down Expand Up @@ -591,8 +591,7 @@ func (v *Volume) NodeStageVolume(req *csi.NodeStageVolumeRequest) (*csi.NodeStag

// NodeUnstageVolume implementation
func (v *Volume) NodeUnstageVolume(req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {

vol, _, err := v.getVolumeAndAttachmentByVolumeId(req.VolumeId)
vol, attachment, err := v.getVolumeAndAttachmentByVolumeId(req.VolumeId)
if err != nil {
return nil, status.Error(codes.NotFound, err.Error())
}
Expand All @@ -619,6 +618,20 @@ func (v *Volume) NodeUnstageVolume(req *csi.NodeUnstageVolumeRequest) (*csi.Node
glog.Error(msg)
return nil, status.Error(codes.FailedPrecondition, msg)
}

volConnector := connector.NewConnector(attachment.DriverVolumeType)
if volConnector == nil {
msg := fmt.Sprintf("unsupported driver volume type: %s", attachment.DriverVolumeType)
glog.Error(msg)
return nil, status.Error(codes.FailedPrecondition, msg)
}

err = volConnector.Detach(attachment.ConnectionData)
if err != nil {
msg := fmt.Sprintf("failed to detach device: %v", err)
glog.Error(msg)
return nil, status.Error(codes.FailedPrecondition, msg)
}
}

if CSIBlock == vol.Metadata[CSIVolumeMode] {
Expand Down
4 changes: 2 additions & 2 deletions flexvolume/cmd/flex-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (plugin *OpenSDSPlugin) Attach(opts interface{}) Result {
}

//create attachment to indicate the volume is been processed.
localIqn, _ := connector.NewConnector("iscsi").GetInitiatorInfo()
localIqnList, _ := connector.NewConnector("iscsi").GetInitiatorInfo()

attachReq := &model.VolumeAttachmentSpec{
VolumeId: volID,
Expand All @@ -150,7 +150,7 @@ func (plugin *OpenSDSPlugin) Attach(opts interface{}) Result {
OsType: runtime.GOOS,
Ip: connector.GetHostIP(),
Host: hostname,
Initiator: localIqn,
Initiator: localIqnList[0],
},
Status: VOLUME_STATUS_ATTACHING,
Metadata: vol.Metadata,
Expand Down
12 changes: 0 additions & 12 deletions vendor/github.com/opensds/opensds/contrib/connector/common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/opensds/opensds/contrib/connector/connector.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/opensds/opensds/contrib/connector/fc/fc.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions vendor/github.com/opensds/opensds/contrib/connector/fc/fibreChannel.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vendor/github.com/opensds/opensds/contrib/connector/iscsi/helper.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/opensds/opensds/contrib/connector/iscsi/iscsi.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/opensds/opensds/contrib/connector/nfs/helper.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/opensds/opensds/contrib/connector/nfs/nfs.go
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4299903

Please sign in to comment.