Channel should remain open if there is still a routine that wants to write into it

Signed-off-by: Jerome Küttner <j.kuettner@mittwald.de>
(cherry picked from commit 9a492f8240)
release-3.7 v3.7.2
Jerome Küttner 4 years ago committed by Matt Farina
parent 95c03eecdb
commit 663a896f4a
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9

@ -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.

Loading…
Cancel
Save