Skip to content

Commit

Permalink
Fix error caused by incorrect select case statement
Browse files Browse the repository at this point in the history
Longhorn 8548

Signed-off-by: Derek Su <[email protected]>
  • Loading branch information
derekbit committed May 11, 2024
1 parent 8767252 commit 1e41fdd
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions longhorndev/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,12 @@ func (d *LonghornDevice) FinishUpgrade() (err error) {

stopCh := make(chan struct{})
socketError := d.WaitForSocket(stopCh)
select {
case err = <-socketError:
if err != nil {
logrus.Errorf("error waiting for the socket %v", err)
err = errors.Wrapf(err, "error waiting for the socket")
}
break
default:
err = <-socketError
if err != nil {
logrus.Errorf("error waiting for the socket %v", err)
err = errors.Wrapf(err, "error waiting for the socket")
}

close(stopCh)
close(socketError)

Expand Down

0 comments on commit 1e41fdd

Please sign in to comment.