Skip to content
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
2 changes: 1 addition & 1 deletion pkg/iscsi/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacit
}

// ControllerGetCapabilities implements the default GRPC callout.
// Default supports all capabilities
// Default supports all capabilities.
func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) {
klog.V(5).Infof("Using default ControllerGetCapabilities")

Expand Down
4 changes: 2 additions & 2 deletions pkg/iscsi/iscsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func getISCSIInfo(req *csi.NodePublishVolumeRequest) (*iscsiDisk, error) {
}

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

iface := req.GetVolumeContext()["iscsiInterface"]
Expand Down Expand Up @@ -151,7 +151,7 @@ func getISCSIDiskUnmounter(req *csi.NodeUnpublishVolumeRequest) *iscsiDiskUnmoun

func portalMounter(portal string) string {
if !strings.Contains(portal, ":") {
portal = portal + ":3260"
portal += ":3260"
}
return portal
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/iscsi/iscsi_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) {
mntPath := b.targetPath
notMnt, err := b.mounter.IsLikelyNotMountPoint(mntPath)
if err != nil && !os.IsNotExist(err) {
return "", fmt.Errorf("Heuristic determination of mount point failed:%v", err)
return "", fmt.Errorf("heuristic determination of mount point failed:%v", err)
}
if !notMnt {
klog.Infof("iscsi: %s already mounted", mntPath)
Expand Down Expand Up @@ -86,7 +86,7 @@ func (util *ISCSIUtil) DetachDisk(c iscsiDiskUnmounter, targetPath string) error
return err
}
if pathExists, pathErr := mount.PathExists(targetPath); pathErr != nil {
return fmt.Errorf("Error checking if path exists: %v", pathErr)
return fmt.Errorf("error checking if path exists: %v", pathErr)
} else if !pathExists {
klog.Warningf("Warning: Unmount skipped because path does not exist: %v", targetPath)
return nil
Expand Down Expand Up @@ -128,6 +128,7 @@ func (util *ISCSIUtil) DetachDisk(c iscsiDiskUnmounter, targetPath string) error
}

klog.Info("successfully detached ISCSI device")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it's better remove L131 & L133 empty lines

return nil

}
Expand Down
15 changes: 8 additions & 7 deletions pkg/iscsi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ import (
"k8s.io/klog/v2"
)

// Defines Non blocking GRPC server interfaces
// Defines Non blocking GRPC server interfaces.
type NonBlockingGRPCServer interface {
// Start services at the endpoint
Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer)
// Waits for the service to stop
// Wait waits for the service to stop
Wait()
// Stops the service gracefully
// Stop stops the service gracefully
Stop()
// Stops the service forcefully
// ForceStop Stops the service forcefully
ForceStop()
}

Expand Down Expand Up @@ -104,9 +104,10 @@ func (s *nonBlockingGRPCServer) serve(endpoint string, ids csi.IdentityServer, c
if ns != nil {
csi.RegisterNodeServer(server, ns)
}

klog.Infof("Listening for connections on address: %#v", listener.Addr())

server.Serve(listener)
err = server.Serve(listener)
if err != nil {
klog.Fatalf("Failed to serve requests: %v", err)
}

}