Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Bind Docker guide clock checks to guarded cache hits

pulse-triage[bot]444dfa591687
diff --git a/frontend-modern/src/features/docs/__tests__/dockerUpdateGuide.test.ts b/frontend-modern/src/features/docs/__tests__/dockerUpdateGuide.test.ts
index 05c3d1f90d..e1544052fc 100644
--- a/frontend-modern/src/features/docs/__tests__/dockerUpdateGuide.test.ts
+++ b/frontend-modern/src/features/docs/__tests__/dockerUpdateGuide.test.ts
@@ -53,9 +53,14 @@ describe('shipped monitored-container update guide', () => {
'utf8',
);
expect(registry).toMatch(/defaultCacheTTL\s*=\s*6\s*\*\s*time.Hour/);
+ // A changed local image can now bypass old evidence through the bounded
+ // refresh helper. Bind the clock assertion to the remaining cache-hit
+ // branch, not the unconditional lookup that preceded that correction.
+ expect(registry).toContain('cached, refresh := r.cachedForLocalImage(cacheKey, currentDigest)');
const cacheHit = registry
- .split('if cached := r.getCached(cacheKey); cached != nil {')[1]
- .split('// Fetch latest digest from registry')[0];
+ .split('if cached != nil && !refresh {')[1]
+ ?.split('// Fetch latest digest from registry')[0];
+ expect(cacheHit, 'the guarded cache-hit branch must remain inspectable').toBeDefined();
expect(cacheHit).toMatch(/LatestDigest:\s+cached.latestDigest/);
expect(cacheHit).toMatch(/CheckedAt:\s+time.Now\(\)/);
expect(collector).toMatch(/LastChecked:\s+result.CheckedAt/);