consul_syncer 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/consul_syncer.rb +4 -4
- data/lib/consul_syncer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59b87094f77b404c59b018035020eab02be5075c3b3d9dc3e68f28a64d8f70c0
|
4
|
+
data.tar.gz: c61781655c3a8a67e266da1e97578b9e996d7c4b43248c777ef43e35608ba8ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f164174999daa718fe237edbff4a0b1ca3389ab56db5af2ce57cfd7876c20b0d5563de016b649677e0bd14b3d7e7c544c8857a27bb271eae1291fe6a43f02da
|
7
|
+
data.tar.gz: bfd88ffae1281a70b942fb6f766fbabcc20f4ec49aca1df311a5cf79e4f6c08dc4dbd13f77110b8f38be4260e3e7a4daba8431d5996279739f475d1d0a71de6f
|
data/lib/consul_syncer.rb
CHANGED
@@ -17,7 +17,7 @@ class ConsulSyncer
|
|
17
17
|
|
18
18
|
# changing tags means all previous services need to be removed manually since
|
19
19
|
# they can no longer be found
|
20
|
-
def sync(expected_definitions, tags)
|
20
|
+
def sync(expected_definitions, tags, dry: false)
|
21
21
|
raise ArgumentError, "Need at least 1 tag to reliably update endpoints" if tags.empty?
|
22
22
|
|
23
23
|
modified = 0
|
@@ -61,11 +61,11 @@ class ConsulSyncer
|
|
61
61
|
elsif remove_matching_service!(actual_definitions, expected, identifying)
|
62
62
|
@logger.info "Updating #{description}"
|
63
63
|
modified += 1
|
64
|
-
register **expected
|
64
|
+
register **expected unless dry
|
65
65
|
else
|
66
66
|
@logger.info "Adding #{description}"
|
67
67
|
modified += 1
|
68
|
-
register **expected
|
68
|
+
register **expected unless dry
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -73,7 +73,7 @@ class ConsulSyncer
|
|
73
73
|
actual_definitions.each do |actual|
|
74
74
|
@logger.info "Removing #{actual.fetch(:service)} / #{actual.fetch(:service_id)} on #{actual.fetch(:node)} in Consul"
|
75
75
|
modified += 1
|
76
|
-
deregister actual.fetch(:node), actual.fetch(:service_id)
|
76
|
+
deregister actual.fetch(:node), actual.fetch(:service_id) unless dry
|
77
77
|
end
|
78
78
|
|
79
79
|
modified
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: consul_syncer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.2.16
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Sync remote services into consul
|