forgejo: actionsFromSelf defaults to whether this host runs the swarm-controller
The controller seeds the actions/checkout mirror from its own host's mirror list, so a forge host without it got DEFAULT_ACTIONS_URL = self and no mirror. The default now follows deploy.swarm-controller.enable; the module-eval check pins forge-only (false, no warning) and forge+controller (true, mirror seeded).
This commit is contained in:
parent
80bc92fb49
commit
84347f122c
4 changed files with 45 additions and 8 deletions
|
|
@ -117,6 +117,11 @@ let
|
|||
deploy.forgejo.enable = true;
|
||||
deploy.forgejo.mirrors = [ aMirror ];
|
||||
};
|
||||
forgeOnly = hive { deploy.forgejo.enable = true; };
|
||||
forgeWithController = hive {
|
||||
deploy.swarm-controller.enable = true;
|
||||
deploy.forgejo.enable = true;
|
||||
};
|
||||
controllerWithSelfActions = hive {
|
||||
deploy.swarm-controller.enable = true;
|
||||
deploy.forgejo.enable = true;
|
||||
|
|
@ -469,6 +474,24 @@ let
|
|||
&& mirrorsOf controllerWithMirrors == [ aMirror ]
|
||||
&& actionsUrlOf controllerWithMirrors == null;
|
||||
}
|
||||
{
|
||||
# The default follows the controller, the only thing that seeds the
|
||||
# checkout mirror: a forge alone must not resolve actions from itself.
|
||||
name = "actionsFromSelf defaults to whether this host runs the swarm-controller";
|
||||
ok =
|
||||
let
|
||||
actionsUrlOf =
|
||||
m: m.containers.hive-forge.config.services.forgejo.settings.actions.DEFAULT_ACTIONS_URL or null;
|
||||
mirrorsOf =
|
||||
m: builtins.fromJSON m.systemd.services.swarm-controller.environment.SWARM_CONTROLLER_FORGE_MIRRORS;
|
||||
in
|
||||
!forgeOnly.services.hyperhive.deploy.forgejo.actionsFromSelf
|
||||
&& actionsUrlOf forgeOnly == null
|
||||
&& forgeOnly.warnings == [ ]
|
||||
&& forgeWithController.services.hyperhive.deploy.forgejo.actionsFromSelf
|
||||
&& actionsUrlOf forgeWithController == "self"
|
||||
&& lib.elem "actions/checkout" (map (m: m.dest) (mirrorsOf forgeWithController));
|
||||
}
|
||||
{
|
||||
name = "the old c0re org-avatar option lands on the controller's unit";
|
||||
ok =
|
||||
|
|
|
|||
Loading…
Reference in a new issue