diff options
| author | Jeff Carr <[email protected]> | 2024-10-27 08:10:19 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-27 08:10:19 -0500 |
| commit | d38865a6cf3d9e11803e9f565a0dd0c763de479d (patch) | |
| tree | 98dcb257089a3fb117a9872a7d08691e85917760 /validate.go | |
| parent | 7288595efc0c029adf33f7b3edd4627810ccb0ca (diff) | |
maybe fix duplicates? this isn't really safe probably
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'validate.go')
| -rw-r--r-- | validate.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/validate.go b/validate.go index 5270484..a95ce29 100644 --- a/validate.go +++ b/validate.go @@ -230,8 +230,21 @@ func setUniqueSpicePort(check *pb.Droplet) error { if d.SpicePort == 0 { continue } - if _, ok := ports[d.SpicePort]; ok { - log.Info("duplicate ports", d.SpicePort) + if dup, ok := ports[d.SpicePort]; ok { + // dup := ports[d.SpicePort] + log.Warn("duplicate ports", d.SpicePort, d.Hostname, d.CurrentState) + if d.CurrentState != pb.DropletState_ON { + // hack for now. should be safe to erase this + d.SpicePort = 0 + log.Warn("erasing port for non-ON droplet", d.SpicePort, d.Hostname, d.CurrentState) + } + log.Warn("duplicate ports", dup.SpicePort, dup.Hostname, dup.CurrentState) + if dup.CurrentState != pb.DropletState_ON { + // hack for now. should be safe to erase this + dup.SpicePort = 0 + log.Warn("erasing port for non-ON droplet", dup.SpicePort, dup.Hostname, dup.CurrentState) + } + // todo: fix this somewhow return errors.New("duplicate ports") } ports[d.SpicePort] = d @@ -242,7 +255,7 @@ func setUniqueSpicePort(check *pb.Droplet) error { } var start int64 - start = 5900 + start = 5910 for { if start == 6000 { // x11 might use this on dom0's running a desktop |
