[release] v0.16.0-unstable59

This commit is contained in:
Yann Stepienik
2024-09-21 13:39:30 +01:00
parent 9eb4e3eae8
commit 97b16d266e
2 changed files with 3 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.16.0-unstable58",
"version": "0.16.0-unstable59",
"description": "",
"main": "test-server.js",
"bugs": {

View File

@@ -254,11 +254,9 @@ func EditContainer(oldContainerID string, newConfig types.ContainerJSON, noLock
// only force hostname if network is bridge or default, otherwise it will fail
if newConfig.HostConfig.NetworkMode == "bridge" || newConfig.HostConfig.NetworkMode == "default" {
newConfig.Config.Hostname = newName[1:]
} else if newConfig.HostConfig.NetworkMode != "host" && newConfig.HostConfig.NetworkMode != "none" {
// if not bridge, default, host or none, restore hostname
newConfig.Config.Hostname = oldContainer.Config.Hostname
} else {
// if not, remove hostname because otherwise it will try to keep the old one
// if not, remove hostname because otherwise it will try to keep the old one but other network modes
// don't allow for hostnames!
newConfig.Config.Hostname = ""
// IDK Docker is weird, if you don't erase this it will break
newConfig.Config.ExposedPorts = nil