* fix(compose): strip and resolve pre-deploy hook secrets like service env (fixes#422)
normaliseContainerForStore only cleared Config.Env and
ServiceSpec.Container.Env before writing a container record to the
replicated Corrosion store, leaving ServiceSpec.PreDeploy.Env in place.
A secret set via x-pre_deploy.environment therefore replicated to
every machine in the cluster, unlike the same value set via
environment.
ResolveSecrets had the same asymmetry in the other direction: it only
resolved secret://name references in service.Environment, so a
reference placed in the pre-deploy hook's environment passed through
unresolved as a literal string. HasCommandSecretRefs is extended the
same way for consistency.
Add tests pinning both behaviours.
* update docs that secret references are available for pre-deploy hooks
---------
Co-authored-by: Pasha Sviderski <me@psviderski.name>
* feat(dns): implement extra dns names for machine in m.internal
This implements <machinename>.m.internal and <machineid>.m.internal as
names that can be queried in the cluster.
Listing all machines/services is not implemented, this may come later.
Fixes: #340
Signed-off-by: Miek Gieben <miek@miek.nl>
* Implement getting all machine address
A query for m.internal returns all ip address
There is no overflow check
Signed-off-by: Miek Gieben <miek@miek.nl>
---------
Signed-off-by: Miek Gieben <miek@miek.nl>
* feat: Adding a "nearest.service.local" mode to internal DNS
* Pass listenAddr to internal DNS server (rather than calling into network.MachineIP)
Also adds an exact round-robin via "rr.{service}" mode. Not sure we want that over random or not, though.
* Remove the resolved count and rotating round-robin. "rr.name" mode is now the same as default with random shuffle.
* Add test on nearest internal DNS lookup
* Add docs on internal DNS order modes
* feat: support compose.yaml `service.gpus` and `service.deploy.resources.reservations.devices` DeviceRequests to Docker container
* Fix lint error
* Adjust test comments to work with linter
* Rename DeviceRequests to DeviceReservations to be more consistent with compose nomenclature
* Device reservation changes are immutable and should trigger a container recreate rather than update