Skip to content

Commit

Permalink
Merge pull request #99 from andyzhangx/refine
Browse files Browse the repository at this point in the history
chore: remove iscsiplugin.sh in iscsi Dockerfile
  • Loading branch information
k8s-ci-robot committed Feb 13, 2022
2 parents 3e1116b + 4914be4 commit f677630
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 39 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ RUN clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs btrfs
# install updated packages to fix CVE issues
RUN clean-install libgmp10 bsdutils

# Copy iscsiplugin.sh
COPY iscsiplugin.sh /iscsiplugin.sh
# Copy iscsiplugin from build _output directory
CMD service iscsid start
COPY ./bin/iscsiplugin /iscsiplugin

ENTRYPOINT ["sh", "/iscsiplugin.sh"]
ENTRYPOINT ["/iscsiplugin"]
1 change: 1 addition & 0 deletions deploy/csi-iscsi-driverinfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ spec:
attachRequired: false
volumeLifecycleModes:
- Persistent
- Ephemeral
2 changes: 2 additions & 0 deletions deploy/csi-iscsi-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ spec:
image: gcr.io/k8s-staging-sig-storage/iscsiplugin:canary
args:
- "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
env:
- name: NODE_ID
valueFrom:
Expand Down
25 changes: 0 additions & 25 deletions iscsiplugin.sh

This file was deleted.

22 changes: 12 additions & 10 deletions pkg/iscsi/iscsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func getISCSIInfo(req *csi.NodePublishVolumeRequest) (*iscsiDisk, error) {
return nil, fmt.Errorf("ISCSI target information is missing")
}

portalList := req.GetVolumeContext()["portals"]
secretParams := req.GetVolumeContext()["secret"]
secret := parseSecret(secretParams)
sessionSecret, err := parseSessionSecret(secret)
Expand All @@ -50,17 +49,20 @@ func getISCSIInfo(req *csi.NodePublishVolumeRequest) (*iscsiDisk, error) {
return nil, err
}

portal := portalMounter(tp)
var bkportal []string
bkportal = append(bkportal, portal)
bkportal := []string{}

portals := []string{}
if err := json.Unmarshal([]byte(portalList), &portals); err != nil {
return nil, err
}
portalList := req.GetVolumeContext()["portals"]
if len(portalList) > 0 {
portal := portalMounter(tp)
bkportal = append(bkportal, portal)
portals := []string{}
if err := json.Unmarshal([]byte(portalList), &portals); err != nil {
return nil, err
}

for _, portal := range portals {
bkportal = append(bkportal, portalMounter(portal))
for _, portal := range portals {
bkportal = append(bkportal, portalMounter(portal))
}
}

iface := req.GetVolumeContext()["iscsiInterface"]
Expand Down

0 comments on commit f677630

Please sign in to comment.