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

This commit is contained in:
2026-10-19 15:55:10 +02:00
parent e1a2abf1e3
commit 546eef37bd
5 changed files with 205 additions and 1 deletions
+12 -1
View File
@@ -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,
}