Watch
0
0
Fork
You've already forked hyperhive
0

warn when the in-swarm cache runs under another domain

This commit is contained in:
atlas 2026-10-29 01:12:27 +01:00 • committed by mara
commit 4f32948a97

View file

@ -110,6 +110,11 @@ let
swarm.attic.domain = "cache.example.org";
swarm.attic.cache = "grid";
};
atticWarnings =
m:
lib.length (
lib.filter (lib.hasInfix "services.hyperhive.deploy.attic.enable is on while") m.warnings
);
hasAtticHost =
m:
m.containers ? swarm-attic
@ -369,6 +374,18 @@ let
&& !(atticByHand.services.hyperhive.gateway.vhosts ? "attic.t.local")
&& atticHere.services.hyperhive.gateway.vhosts ? "attic.t.local";
}
{
# The cache running here under a name other than its own warns once, naming
# the fix. `atticHere` (default name) and `atticExternal` (cache off) are
# the controls that the same lookup finds no warning.
name = "the cache running under another name warns once, and the default and an external cache do not";
ok =
atticWarnings atticByHand == 1
&& lib.any (lib.hasInfix "lib.mkForce false") atticByHand.warnings
&& lib.any (lib.hasInfix "cache.example.org") atticByHand.warnings
&& atticWarnings atticHere == 0
&& atticWarnings atticExternal == 0;
}
{
# An operator's external cache on a host that hosts the shared services:
# with the switch forced off nothing of the cache is rendered, and the