style: gofmt normalization — no logic changes
gofmt -w across the controller tree (46 files) so gofmt -l is empty — disarms the
formatting landmine where a targeted edit + accidental gofmt -w swept ~46 unrelated
files. Pure formatting: whitespace + gofmt's optional-semicolon removal in reflowed
inline closures. One doc comment reworded ('' -> 'the empty string') to avoid gofmt's
Go-1.19 doc-comment typographic substitition ('' -> curly quote) muddying its meaning.
No build/vet/test behavior change.
This commit is contained in:
@@ -321,4 +321,3 @@ func buildStacksReport(stackMgr *stacks.Manager) StacksReport {
|
||||
|
||||
return sr
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import "log"
|
||||
// - Applied reads the persisted last-applied config_version (0 = none recorded yet).
|
||||
// - Record persists a newly-applied config_version.
|
||||
// - Refresh re-pulls controller.yaml from the hub and writes it (re-merging local_api). It must
|
||||
// NOT touch settings.json. A hub-unreachable / write failure returns an error.
|
||||
// NOT touch settings.json. A hub-unreachable / write failure returns an error.
|
||||
// - Restart triggers the graceful self-restart (process exit → Docker restart → fresh config).
|
||||
type ConfigRefresher struct {
|
||||
Applied func() int
|
||||
|
||||
@@ -86,9 +86,9 @@ func TestEscrowConfirm_StaleBlobStaysPending(t *testing.T) {
|
||||
// Scenario C — no status / hash-less blob / no local password file → stay pending SILENTLY.
|
||||
func TestEscrowConfirm_SilentPendingCases(t *testing.T) {
|
||||
h := newConfirmer(t)
|
||||
h.c.Reconcile(nil) // no escrow row on the hub
|
||||
h.c.Reconcile(&EscrowStatus{IdentityBlobPresent: true}) // hash NULL (legacy blob)
|
||||
h.c.Reconcile(&EscrowStatus{IdentityBlobPresent: false, ResticPwSHA256: hubHash}) // hash without identity blob — fail-closed
|
||||
h.c.Reconcile(nil) // no escrow row on the hub
|
||||
h.c.Reconcile(&EscrowStatus{IdentityBlobPresent: true}) // hash NULL (legacy blob)
|
||||
h.c.Reconcile(&EscrowStatus{IdentityBlobPresent: false, ResticPwSHA256: hubHash}) // hash without identity blob — fail-closed
|
||||
h.localOK = false
|
||||
h.c.Reconcile(matchStatus(hubHash)) // no local password file
|
||||
if h.flips != 0 || h.logbuf.Len() != 0 {
|
||||
|
||||
@@ -9,22 +9,22 @@ import (
|
||||
|
||||
// Report is the JSON payload pushed to the central hub.
|
||||
type Report struct {
|
||||
Version int `json:"version"`
|
||||
CustomerID string `json:"customer_id"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
ControllerVersion string `json:"controller_version"`
|
||||
ControllerURL string `json:"controller_url,omitempty"`
|
||||
ConfigHash string `json:"config_hash,omitempty"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
ReportingDisabled bool `json:"reporting_disabled,omitempty"`
|
||||
System SystemReport `json:"system"`
|
||||
Storage []StorageReport `json:"storage"`
|
||||
Containers ContainerReport `json:"containers"`
|
||||
Backup BackupReport `json:"backup"`
|
||||
Health HealthReport `json:"health"`
|
||||
Stacks StacksReport `json:"stacks"`
|
||||
AppTelemetry []AppTelemetry `json:"app_telemetry,omitempty"`
|
||||
GeoRestriction *GeoRestrictionReport `json:"geo_restriction,omitempty"`
|
||||
Version int `json:"version"`
|
||||
CustomerID string `json:"customer_id"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
ControllerVersion string `json:"controller_version"`
|
||||
ControllerURL string `json:"controller_url,omitempty"`
|
||||
ConfigHash string `json:"config_hash,omitempty"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
ReportingDisabled bool `json:"reporting_disabled,omitempty"`
|
||||
System SystemReport `json:"system"`
|
||||
Storage []StorageReport `json:"storage"`
|
||||
Containers ContainerReport `json:"containers"`
|
||||
Backup BackupReport `json:"backup"`
|
||||
Health HealthReport `json:"health"`
|
||||
Stacks StacksReport `json:"stacks"`
|
||||
AppTelemetry []AppTelemetry `json:"app_telemetry,omitempty"`
|
||||
GeoRestriction *GeoRestrictionReport `json:"geo_restriction,omitempty"`
|
||||
|
||||
// DR recipe — the controller (customer + apps) half of the secret-free reconstruction recipe
|
||||
// (SPIKE-dr-recipe-2026-06-16). The hub assembles it with the agent's storage/guest/PBS half.
|
||||
|
||||
Reference in New Issue
Block a user