Skip to content

Commit

Permalink
fix: eliminate a potential deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-soubeyrand committed Mar 21, 2020
1 parent 906242f commit 3b0c332
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ func runHelm() (errs []error) {
default:
}

cleartextSecretFile, err := os.OpenFile(cleartextSecretFilename, os.O_RDONLY, 0)
cleartextSecretFile, err := os.OpenFile(cleartextSecretFilename, os.O_RDWR, 0)

if err != nil {
*errs = append(*errs, fmt.Errorf("failed to open cleartext secret pipe '%s' in pipe closer: %s", cleartextSecretFilename, err))

return
}

<-pipeWriterUnlockedChannel

defer func() {
err := cleartextSecretFile.Close()

Expand Down

0 comments on commit 3b0c332

Please sign in to comment.