v0.334.0: a live box refreshes its config with its own hub key (GET /box-config; R-1159, operator D19)
gates / gates (push) Successful in 49s
gates / gates (push) Successful in 49s
This commit is contained in:
@@ -1173,7 +1173,18 @@ func main() {
|
||||
cr := &report.ConfigRefresher{
|
||||
Applied: sett.GetAppliedConfigVersion,
|
||||
Record: sett.SetAppliedConfigVersion,
|
||||
Refresh: func() error { return bootstrap.RefreshConfig(*configPath, logger, pull) },
|
||||
// R-1159 (v0.334.0): a live box refreshes with its OWN hub key (GET /box-config); the retrieval
|
||||
// passphrase only against a hub without that route. The hub then refuses the passphrase's keys once
|
||||
// this box has reported.
|
||||
Refresh: func() error {
|
||||
return bootstrap.RefreshConfig(*configPath, logger, func(hubURL, customerID, rp string) (string, error) {
|
||||
y, perr := report.PullConfigPreferKey(hubURL, customerID, cfg.Hub.APIKey, rp, logger.Printf)
|
||||
if perr != nil && errors.Is(perr, report.ErrHubUnreachable) {
|
||||
return "", fmt.Errorf("%w: %w", bootstrap.ErrPullTransient, perr)
|
||||
}
|
||||
return y, perr
|
||||
})
|
||||
},
|
||||
Restart: func() { api.GracefulSelfRestart(logger) },
|
||||
Logger: logger,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user