Compare commits
3 changed files with 14 additions and 16 deletions
|
|
@ -69,6 +69,10 @@ in
|
||||||
[ "services" "hyperhive" "swarm" "controller" "enable" ]
|
[ "services" "hyperhive" "swarm" "controller" "enable" ]
|
||||||
[ "services" "hyperhive" "deploy" "swarm-controller" "enable" ]
|
[ "services" "hyperhive" "deploy" "swarm-controller" "enable" ]
|
||||||
)
|
)
|
||||||
|
(lib.mkRenamedOptionModule
|
||||||
|
[ "services" "hyperhive" "swarm" "controller" "socketPath" ]
|
||||||
|
[ "services" "hyperhive" "deploy" "swarm-controller" "socketPath" ]
|
||||||
|
)
|
||||||
(lib.mkRenamedOptionModule
|
(lib.mkRenamedOptionModule
|
||||||
[ "services" "hyperhive" "swarm" "controller" "forgeTokenFile" ]
|
[ "services" "hyperhive" "swarm" "controller" "forgeTokenFile" ]
|
||||||
[ "services" "hyperhive" "deploy" "swarm-controller" "forgeTokenFile" ]
|
[ "services" "hyperhive" "deploy" "swarm-controller" "forgeTokenFile" ]
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,6 @@ in
|
||||||
socketPath = lib.mkOption {
|
socketPath = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "/run/swarm-controller/controller.sock";
|
default = "/run/swarm-controller/controller.sock";
|
||||||
readOnly = true;
|
|
||||||
description = ''
|
description = ''
|
||||||
Unix socket the daemon serves on, and the path the gateway's nginx
|
Unix socket the daemon serves on, and the path the gateway's nginx
|
||||||
proxies to.
|
proxies to.
|
||||||
|
|
|
||||||
|
|
@ -201,12 +201,13 @@ let
|
||||||
deploy.matrix.maxRequestSize = 99000000;
|
deploy.matrix.maxRequestSize = 99000000;
|
||||||
};
|
};
|
||||||
|
|
||||||
# `enable` is spelled the OLD way like everything else here, so all six
|
# `enable` is spelled the OLD way like everything else here, so all seven
|
||||||
# of the controller's shims are exercised rather than five.
|
# of the controller's shims are exercised rather than six.
|
||||||
controllerOldPath = hive {
|
controllerOldPath = hive {
|
||||||
swarm.controller.enable = true;
|
swarm.controller.enable = true;
|
||||||
swarm.controller.package = pkgs.emptyDirectory;
|
swarm.controller.package = pkgs.emptyDirectory;
|
||||||
swarm.controller.swarmctlPackage = pkgs.emptyDirectory;
|
swarm.controller.swarmctlPackage = pkgs.emptyDirectory;
|
||||||
|
swarm.controller.socketPath = "/run/test-ctrl/ctrl.sock";
|
||||||
swarm.controller.forgeTokenFile = "/run/secrets/ctrl-forge.token";
|
swarm.controller.forgeTokenFile = "/run/secrets/ctrl-forge.token";
|
||||||
swarm.controller.authBridgeUrl = "http://127.0.0.1:19097";
|
swarm.controller.authBridgeUrl = "http://127.0.0.1:19097";
|
||||||
swarm.controller.queue.clientSecretFile = "/run/secrets/ctrl-queue.secret";
|
swarm.controller.queue.clientSecretFile = "/run/secrets/ctrl-queue.secret";
|
||||||
|
|
@ -961,25 +962,19 @@ let
|
||||||
# Reads the host's tmpfiles rules, not the options: the socket directory
|
# Reads the host's tmpfiles rules, not the options: the socket directory
|
||||||
# nginx and the container share is created there, so a rename that
|
# nginx and the container share is created there, so a rename that
|
||||||
# resolved but stopped reaching the module would leave the gateway
|
# resolved but stopped reaching the module would leave the gateway
|
||||||
# proxying to a path nothing creates. All three old paths are defined
|
# proxying to a path nothing creates. All four old paths are defined in
|
||||||
# in the fixture, so removing any single shim fails the eval rather
|
# the fixture, so removing any single shim fails the eval rather than
|
||||||
# than only the one this assertion reads.
|
# only the one this assertion reads.
|
||||||
# THREE movers (authBridgeUrl, forgeTokenFile, queue.clientSecretFile)
|
# All FOUR movers are asserted as rendered effects rather than as option
|
||||||
# are asserted as rendered effects rather than as option values, so a
|
# values, so a rename that resolved but stopped reaching the module is
|
||||||
# rename that resolved but stopped reaching the module is caught
|
# caught per-option instead of only where one assertion happens to look.
|
||||||
# per-option instead of only where one assertion happens to look.
|
|
||||||
# socketPath is no longer one of them: it went readOnly and lost its
|
|
||||||
# shim in the same slice, so it has no pre-rename path left to prove
|
|
||||||
# reaches the unit — the SOCKET line below instead pins the one value
|
|
||||||
# it can ever hold, the default, so the env var vanishing or being
|
|
||||||
# misspelled still fails this arm.
|
|
||||||
name = "a config written against the pre-rename swarm-controller paths still reaches the unit";
|
name = "a config written against the pre-rename swarm-controller paths still reaches the unit";
|
||||||
ok =
|
ok =
|
||||||
let
|
let
|
||||||
u = controllerOldPath.systemd.services.swarm-controller;
|
u = controllerOldPath.systemd.services.swarm-controller;
|
||||||
creds = u.serviceConfig.LoadCredential;
|
creds = u.serviceConfig.LoadCredential;
|
||||||
in
|
in
|
||||||
u.environment.SWARM_CONTROLLER_SOCKET == "/run/swarm-controller/controller.sock"
|
u.environment.SWARM_CONTROLLER_SOCKET == "/run/test-ctrl/ctrl.sock"
|
||||||
&& u.environment.SWARM_CONTROLLER_AUTH_BRIDGE_URL == "http://127.0.0.1:19097"
|
&& u.environment.SWARM_CONTROLLER_AUTH_BRIDGE_URL == "http://127.0.0.1:19097"
|
||||||
&& lib.any (c: lib.hasInfix "/run/secrets/ctrl-queue.secret" c) creds
|
&& lib.any (c: lib.hasInfix "/run/secrets/ctrl-queue.secret" c) creds
|
||||||
&& lib.any (c: lib.hasInfix "/run/secrets/ctrl-forge.token" c) creds;
|
&& lib.any (c: lib.hasInfix "/run/secrets/ctrl-forge.token" c) creds;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue