dash 4.0.3 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dash/cli/proxy/loadbalancer_reboot.rb +11 -0
- data/lib/dash/cli/proxy.rb +14 -3
- data/lib/dash/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 762f586250ded9a4e4f60850a91b1358bd993bcb1d4c6e291dfec93dc6d516e2
|
|
4
|
+
data.tar.gz: d87d3161396bfdb38f9feb3d3946d0830bdd2b1dc2921e569a275e65f4285cb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86a1e05606121be7d85b83c2da117d8bcc2a2badbf080a5e5d0237b3175dd98ac9abba3d1afa154495d6be85923d8ef7d915e3bb877241b69a637ab47de00658
|
|
7
|
+
data.tar.gz: 9bca1f4085e3ad18ca778eba0dc3344b6592404839fdb4628a2a1bc05d81d869c4b4a837a18f66659f2c0b9fba307da4f14d877f0c088f709d72806a68bf2927
|
|
@@ -19,6 +19,7 @@ class Dash::Cli::Proxy::LoadbalancerReboot
|
|
|
19
19
|
def run
|
|
20
20
|
execute *DASH.auditor.record("Rebooted loadbalancer"), verbosity: :debug
|
|
21
21
|
execute *DASH.registry.login
|
|
22
|
+
ensure_network
|
|
22
23
|
|
|
23
24
|
info "Stopping and removing #{DASH.loadbalancer.container_name} on #{host}, if running..."
|
|
24
25
|
execute *DASH.loadbalancer.stop, raise_on_non_zero_exit: false
|
|
@@ -45,6 +46,16 @@ class Dash::Cli::Proxy::LoadbalancerReboot
|
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
private
|
|
49
|
+
# Before the old container is stopped: `docker run` against a missing
|
|
50
|
+
# network would otherwise fail with the edge already down. A dedicated
|
|
51
|
+
# loadbalancer host has no other path that creates the network
|
|
52
|
+
# (zoolutions/dash#140).
|
|
53
|
+
def ensure_network
|
|
54
|
+
execute *DASH.docker.create_network
|
|
55
|
+
rescue SSHKit::Command::Failed => e
|
|
56
|
+
raise unless e.message.include?("already exists")
|
|
57
|
+
end
|
|
58
|
+
|
|
48
59
|
def wait_until_ready
|
|
49
60
|
deadline = Time.now + READY_TIMEOUT
|
|
50
61
|
|
data/lib/dash/cli/proxy.rb
CHANGED
|
@@ -2,7 +2,7 @@ class Dash::Cli::Proxy < Dash::Cli::Base
|
|
|
2
2
|
desc "boot", "Boot proxy on servers"
|
|
3
3
|
def boot
|
|
4
4
|
modify(lock: true, server_lock: true) do
|
|
5
|
-
on(
|
|
5
|
+
on(network_hosts) do |host|
|
|
6
6
|
execute *DASH.docker.create_network
|
|
7
7
|
rescue SSHKit::Command::Failed => e
|
|
8
8
|
raise unless e.message.include?("already exists")
|
|
@@ -76,8 +76,10 @@ class Dash::Cli::Proxy < Dash::Cli::Base
|
|
|
76
76
|
info "Starting loadbalancer on #{host}..."
|
|
77
77
|
execute *DASH.registry.login
|
|
78
78
|
|
|
79
|
-
# Bring a pre-rename
|
|
80
|
-
# against an empty
|
|
79
|
+
# Bring a pre-rename host across before the container can be created
|
|
80
|
+
# against an empty volume or a network nothing else joined. A no-op
|
|
81
|
+
# once it has been.
|
|
82
|
+
execute *DASH.docker.connect_legacy_network_containers
|
|
81
83
|
execute *DASH.loadbalancer.copy_legacy_config_volume
|
|
82
84
|
|
|
83
85
|
# The load balancer terminates TLS and owns the cache, so its host
|
|
@@ -653,6 +655,15 @@ class Dash::Cli::Proxy < Dash::Cli::Base
|
|
|
653
655
|
end
|
|
654
656
|
|
|
655
657
|
private
|
|
658
|
+
# Every host that runs a container on the proxy network. A dedicated
|
|
659
|
+
# loadbalancer host is not in DASH.hosts, and nothing else creates the
|
|
660
|
+
# network there (zoolutions/dash#140).
|
|
661
|
+
def network_hosts
|
|
662
|
+
hosts = DASH.hosts
|
|
663
|
+
hosts |= [ DASH.config.proxy.effective_loadbalancer ] if DASH.config.proxy.load_balancing?
|
|
664
|
+
hosts
|
|
665
|
+
end
|
|
666
|
+
|
|
656
667
|
# The host that owns TLS, and so the certificate store: the loadbalancer
|
|
657
668
|
# host when load balancing (TLS terminates at the edge), else the primary
|
|
658
669
|
# host - the same host `loadbalancer: true` would resolve to.
|
data/lib/dash/version.rb
CHANGED