Skip to content

Commit 6cac3b3

Browse files
authored
Agent Auto Auth Self Healing for Templates (#26172)
* Agent Auto Auth Self Healing for Templates * Added changelog * Edited go.sum * Edit changelog wording
1 parent c9dafc1 commit 6cac3b3

21 files changed

+606
-41
lines changed

changelog/26172.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:improvement
2+
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.
3+
```

command/agent.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ type AgentCommand struct {
8383

8484
// Telemetry object
8585
metricsHelper *metricsutil.MetricsHelper
86-
87-
cleanupGuard sync.Once
86+
cleanupGuard sync.Once
8887

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

789788
g.Add(func() error {
790-
err := ss.Run(ctx, ah.OutputCh, sinks)
789+
err := ss.Run(ctx, ah.OutputCh, sinks, ah.AuthInProgress)
791790
c.logger.Info("sinks finished, exiting")
792791

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

820819
g.Add(func() error {
821-
return ts.Run(ctx, ah.TemplateTokenCh, config.Templates)
820+
return ts.Run(ctx, ah.TemplateTokenCh, config.Templates, ah.AuthInProgress, ah.InvalidToken)
822821
}, func(error) {
823822
// Let the lease cache know this is a shutdown; no need to evict
824823
// everything

0 commit comments

Comments
 (0)