Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove iscsiplugin.sh in iscsi Dockerfile #99

Merged
merged 1 commit into from
Feb 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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