Skip to content

Commit

Permalink
Few corrections in driver code
Browse files Browse the repository at this point in the history
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
  • Loading branch information
humblec committed Jan 21, 2022
1 parent f0701e9 commit 27a6149
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 10 additions & 5 deletions cmd/iscsiplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ var (
)

func init() {
flag.Set("logtostderr", "true")
flag.Set("logtostderr", "true") //nolint:errcheck
}

func main() {

flag.CommandLine.Parse([]string{})
flag.CommandLine.Parse([]string{}) //nolint:errcheck

cmd := &cobra.Command{
Use: "iscsi.csi.k8s.io",
Expand All @@ -53,10 +52,16 @@ func main() {
cmd.Flags().AddGoFlagSet(flag.CommandLine)

cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "node id")
cmd.MarkPersistentFlagRequired("nodeid")
err := cmd.MarkPersistentFlagRequired("nodeid")
if err != nil {
return
}

cmd.PersistentFlags().StringVar(&endpoint, "endpoint", "", "CSI endpoint")
cmd.MarkPersistentFlagRequired("endpoint")
err = cmd.MarkPersistentFlagRequired("endpoint")
if err != nil {
return
}

if err := cmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "%s", err.Error())
Expand Down
2 changes: 0 additions & 2 deletions pkg/iscsi/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ type driver struct {
nodeID string
version string
endpoint string
ns *nodeServer
cap []*csi.VolumeCapability_AccessMode
cscap []*csi.ControllerServiceCapability
}
Expand Down Expand Up @@ -99,5 +98,4 @@ func (d *driver) AddControllerServiceCapabilities(cl []csi.ControllerServiceCapa

d.cscap = csc

return
}
2 changes: 0 additions & 2 deletions pkg/iscsi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ func (s *nonBlockingGRPCServer) Start(endpoint string, ids csi.IdentityServer, c
s.wg.Add(1)

go s.serve(endpoint, ids, cs, ns)

return
}

func (s *nonBlockingGRPCServer) Wait() {
Expand Down

0 comments on commit 27a6149

Please sign in to comment.