mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
feat: set UNCLOUD_MACHINE_ID in service container ENV (#135)
* Set machine id in service container ENV * Add machine id to clone of the container's env map to avoid exposing serialization format * fix: panic on setting UNCLOUD_MACHINE_ID env var when Env is nil in the spec --------- Co-authored-by: Pasha Sviderski <me@psviderski.name>
This commit is contained in:
1 parent
784d86d8e8
commit
3e804d9ecc
2 files changed
+24
-3
No files matched your search
@@ -282,7 +282,11 @@ func NewMachine(config *Config) (*Machine, error) {
|
||||
internalDNSIP := func() netip.Addr {
|
||||
return m.IP()
|
||||
}
|
||||
m.dockerServer = machinedocker.NewServer(dockerService, db, internalDNSIP, machinedocker.ServerOptions{
|
||||
// Machine ID will only be available after the machine is initialised as a cluster member so wrap it in a function.
|
||||
machineID := func() string {
|
||||
return m.state.ID
|
||||
}
|
||||
m.dockerServer = machinedocker.NewServer(dockerService, db, internalDNSIP, machineID, machinedocker.ServerOptions{
|
||||
NetworkReady: m.IsNetworkReady,
|
||||
WaitForNetworkReady: m.WaitForNetworkReady,
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user