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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 563633a7568cdc7c4567bbe4957af6e5212e37b3ae99ddda0e990552f949762f
4
- data.tar.gz: dda127134f2d0ef7fc4e7636ce7132106842855f9084d082a5a3b65c41313b56
3
+ metadata.gz: 762f586250ded9a4e4f60850a91b1358bd993bcb1d4c6e291dfec93dc6d516e2
4
+ data.tar.gz: d87d3161396bfdb38f9feb3d3946d0830bdd2b1dc2921e569a275e65f4285cb1
5
5
  SHA512:
6
- metadata.gz: 8ebab61a7f7f4df70ecd48e5e95415198a01990e6ae6ce93dca062775f2d11b91d2a971bcf9b0b13b4cd3aa6940700c45f8fc73bc1c50be64fe9478e2e1d7ca8
7
- data.tar.gz: 5cda006f0c95a79eea3198c9caa089d5e3b3d064860b6d031efe12b65513b2d4219ce04b62b5a9c66532bbda38681ba0ec8dd6cd51143b270588a804be647488
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
 
@@ -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(DASH.hosts) do |host|
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 volume across before the container can be created
80
- # against an empty one. A no-op once it has been.
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
@@ -1,3 +1,3 @@
1
1
  module Dash
2
- VERSION = "4.0.3"
2
+ VERSION = "4.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dash
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson