grafana: make socketDir readOnly and drop its rename alias
The socket's directory is its access control, so it has to stay dedicated to Grafana's one socket. Nothing in the tree sets the option; making it read-only turns "point it at a shared directory" into an eval error instead of a convention. A rename shim contributes a definition to its target, which a read-only option refuses, so the swarm.grafana.socketDir alias goes with it. The module-eval fixture no longer sets the old path; a new case asserts that defining the option fails evaluation and that the default reaches nginx.
This commit is contained in:
parent
f08a9cadb6
commit
e2ea842a93
3 changed files with 37 additions and 13 deletions
|
|
@ -50,10 +50,6 @@ in
|
|||
[ "services" "hyperhive" "swarm" "grafana" "enable" ]
|
||||
[ "services" "hyperhive" "deploy" "grafana" "enable" ]
|
||||
)
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "hyperhive" "swarm" "grafana" "socketDir" ]
|
||||
[ "services" "hyperhive" "deploy" "grafana" "socketDir" ]
|
||||
)
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "hyperhive" "swarm" "grafana" "datasourceUrl" ]
|
||||
[ "services" "hyperhive" "deploy" "grafana" "datasourceUrl" ]
|
||||
|
|
@ -110,15 +106,19 @@ in
|
|||
[ "services" "hyperhive" "swarm" "authelia" "usersFile" ]
|
||||
[ "services" "hyperhive" "deploy" "authelia" "usersFile" ]
|
||||
)
|
||||
# `hostClientSecretDir` and `hostUsersFile` deliberately have NO entry
|
||||
# here. A rename module contributes a
|
||||
# *definition* to its target, and both are `readOnly`, which refuses a
|
||||
# second one — so a shim for either makes every evaluation fail with
|
||||
# `hostClientSecretDir`, `hostUsersFile` and `grafana.socketDir`
|
||||
# deliberately have NO entry here. A rename module contributes a
|
||||
# *definition* to its target, and all three are `readOnly`, which refuses a
|
||||
# second one — so a shim for any of them makes every evaluation fail with
|
||||
# "set multiple times", naming the option's own default as the rival
|
||||
# definition. Nothing could have set them anyway: both are derived and
|
||||
# read-only, so the shim's only possible customer is a reader of the old
|
||||
# path, and that reader now gets "option does not exist" instead, which
|
||||
# says the same thing sooner.
|
||||
# definition.
|
||||
#
|
||||
# The first two are derived, so nothing could ever have set them and a
|
||||
# shim's only customer is a reader of the old path. `grafana.socketDir` was
|
||||
# a plain settable option; only a test fixture set it in
|
||||
# this tree, but a deployment outside it can have. That setter now fails
|
||||
# evaluation with "option does not exist" at the old path, rather than
|
||||
# being carried to the new one.
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "hyperhive" "swarm" "nats" "enable" ]
|
||||
[ "services" "hyperhive" "deploy" "nats" "enable" ]
|
||||
|
|
|
|||
Loading…
Reference in a new issue