Skip to content

Commit

Permalink
Agent Auto Auth Self Healing for Templates (#26172)
Browse files Browse the repository at this point in the history
* Agent Auto Auth Self Healing for Templates

* Added changelog

* Edited go.sum

* Edit changelog wording
  • Loading branch information
divyaac authored Mar 27, 2024
1 parent c9dafc1 commit 6cac3b3
Show file tree
Hide file tree
Showing 21 changed files with 606 additions and 41 deletions.
3 changes: 3 additions & 0 deletions changelog/26172.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
agent: Agent will re-trigger auto auth if token used for rendering templates has been revoked, has exceeded the number of uses, or is a bogus value.
```
7 changes: 3 additions & 4 deletions command/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ type AgentCommand struct {

// Telemetry object
metricsHelper *metricsutil.MetricsHelper

cleanupGuard sync.Once
cleanupGuard sync.Once

startedCh chan struct{} // for tests
reloadedCh chan struct{} // for tests
Expand Down Expand Up @@ -787,7 +786,7 @@ func (c *AgentCommand) Run(args []string) int {
})

g.Add(func() error {
err := ss.Run(ctx, ah.OutputCh, sinks)
err := ss.Run(ctx, ah.OutputCh, sinks, ah.AuthInProgress)
c.logger.Info("sinks finished, exiting")

// Start goroutine to drain from ah.OutputCh from this point onward
Expand Down Expand Up @@ -818,7 +817,7 @@ func (c *AgentCommand) Run(args []string) int {
})

g.Add(func() error {
return ts.Run(ctx, ah.TemplateTokenCh, config.Templates)
return ts.Run(ctx, ah.TemplateTokenCh, config.Templates, ah.AuthInProgress, ah.InvalidToken)
}, func(error) {
// Let the lease cache know this is a shutdown; no need to evict
// everything
Expand Down
Loading

0 comments on commit 6cac3b3

Please sign in to comment.