seed a hyperhive/hyperhive mirror so update_meta finds it on a fresh swarm
This commit is contained in:
parent
dbdbed4dcc
commit
a6b5bafa83
1 changed files with 173 additions and 15 deletions
|
|
@ -118,11 +118,13 @@ let
|
|||
upstream = "https://example.invalid/tool";
|
||||
dest = "mirrors/tool";
|
||||
};
|
||||
hyperhiveElsewhere = "https://example.invalid/hyperhive";
|
||||
controllerWithMirrors = hiveWithController {
|
||||
deploy.swarm-controller.enable = true;
|
||||
deploy.forgejo.enable = true;
|
||||
deploy.forgejo.mirrors = [ aMirror ];
|
||||
deploy.forgejo.actionsFromSelf = false;
|
||||
deploy.forgejo.hyperhiveUpstream = null;
|
||||
deploy.swarm-controller.configOrgAvatarPng = "/etc/marker-avatar.png";
|
||||
};
|
||||
mirrorsNoController = hive {
|
||||
|
|
@ -139,6 +141,7 @@ let
|
|||
deploy.forgejo.enable = true;
|
||||
deploy.forgejo.mirrors = [ aMirror ];
|
||||
deploy.forgejo.actionsFromSelf = true;
|
||||
deploy.forgejo.hyperhiveUpstream = hyperhiveElsewhere;
|
||||
};
|
||||
|
||||
# The controller with every shared service on another host, and the same
|
||||
|
|
@ -1371,6 +1374,7 @@ let
|
|||
"mirrors/tool"
|
||||
"actions/checkout"
|
||||
"actions/upload-artifact"
|
||||
"hyperhive/hyperhive"
|
||||
]
|
||||
&& actionsUrlOf controllerWithSelfActions == "self"
|
||||
&& mirrorsOf controllerWithMirrors == [ aMirror ]
|
||||
|
|
@ -1401,6 +1405,28 @@ let
|
|||
&& actionsUrlOf forgeWithController == "self"
|
||||
&& lib.elem "actions/checkout" (map (m: m.dest) (mirrorsOf forgeWithController));
|
||||
}
|
||||
{
|
||||
# The meta flake pins the hyperhive repo on the swarm forge, and a fresh
|
||||
# forge has none, so the controller seeds a mirror of it: by default,
|
||||
# with another upstream when the option says so, and not at all when it
|
||||
# is null (controllerWithMirrors) or without the controller (forgeOnly).
|
||||
name = "a forge beside the controller mirrors hyperhive/hyperhive unless told not to";
|
||||
ok =
|
||||
let
|
||||
mirrorsOf =
|
||||
m: builtins.fromJSON m.systemd.services.swarm-controller.environment.SWARM_CONTROLLER_FORGE_MIRRORS;
|
||||
hyperhiveOf = m: lib.filter (e: e.dest == "hyperhive/hyperhive") (mirrorsOf m);
|
||||
in
|
||||
hyperhiveOf forgeWithController == [
|
||||
{
|
||||
upstream = "https://forge.darkest.space/hyperhive/hyperhive";
|
||||
dest = "hyperhive/hyperhive";
|
||||
}
|
||||
]
|
||||
&& map (e: e.upstream) (hyperhiveOf controllerWithSelfActions) == [ hyperhiveElsewhere ]
|
||||
&& hyperhiveOf controllerWithMirrors == [ ]
|
||||
&& forgeOnly.services.hyperhive.deploy.forgejo.hyperhiveUpstream == null;
|
||||
}
|
||||
{
|
||||
name = "the org avatar lands on the controller's unit, not hive-c0re's";
|
||||
ok =
|
||||
|
|
|
|||
Loading…
Reference in a new issue