Skip to content

Commit

Permalink
Channel should remain open if there is still a routine that wants to …
Browse files Browse the repository at this point in the history
…write into it

Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
  • Loading branch information
jkmw committed Dec 6, 2021
1 parent ad3d2cc commit 9a492f8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/action/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,13 @@ func (u *Upgrade) performUpgrade(ctx context.Context, originalRelease, upgradedR
doneChan := make(chan interface{})
go u.releasingUpgrade(rChan, upgradedRelease, current, target, originalRelease)
go u.handleContext(ctx, doneChan, ctxChan, upgradedRelease)
var result resultMessage
select {
case result = <-rChan:
case result := <-rChan:
doneChan <- true
case result = <-ctxChan:
close(rChan)
return result.r, result.e
case result := <-ctxChan:
return result.r, result.e
}

return result.r, result.e
}

// Function used to lock the Mutex, this is important for the case when the atomic flag is set.
Expand Down

0 comments on commit 9a492f8

Please sign in to comment.