Skip to content

Commit

Permalink
Merge pull request #331 from bank-vaults/fix/negative-wg-panic
Browse files Browse the repository at this point in the history
fix: negative wg panic error
  • Loading branch information
csatib02 authored Dec 2, 2024
2 parents 54cceb9 + 13ba6dd commit 432add4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/reloader/reloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ func (c *Controller) runReloader(ctx context.Context) {
newSecretVersions[secretPath] = currentVersion
}(secretPath, workloads)
}
// wait for secret version checking to complete
wg.Wait()

// Reloading workloads
wg = sync.WaitGroup{} // Reset the WaitGroup
for workloadToReload := range workloadsToReload {
wg.Add(1)
go func(workloadToReload workload) {
defer wg.Done()
reloaderLogger.Info(fmt.Sprintf("Reloading workload: %s", workloadToReload))
Expand All @@ -92,6 +95,8 @@ func (c *Controller) runReloader(ctx context.Context) {
}
}(workloadToReload)
}
// wait for workload reloading to complete
wg.Wait()

// Replace secretVersions map with the new one so we don't keep deleted secrets in the map
c.secretVersions = newSecretVersions
Expand Down

0 comments on commit 432add4

Please # to comment.