harbr 0.1.74 → 0.1.75

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/harbr/job.rb +18 -11
  3. data/lib/harbr/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9877634da31a16119ff1d0e5ecfacdc31f24fde43ad9a7480b35bea64d35e6b1
4
- data.tar.gz: b17a073276840f9ca3afc649890a3fdc9d16a1c79ac8a426b57ec761760ec795
3
+ metadata.gz: 435fad22a3618a2b57938a9550bafdc259672ca3379d893317278df466548ec5
4
+ data.tar.gz: 0e723967c914e25962c32d7741ca1cd01226db9dba05c9d6d769f4d397c1a3a8
5
5
  SHA512:
6
- metadata.gz: d156312501011ccfdc8e00413de6c4c43abc9ae301cc41ec931b25d63ef5e7c9f2c5609c8a53fe72c9e0bbc340fe35355b5f9ad437584cc57dd20319e63870a3
7
- data.tar.gz: aeec78960e4c368d778238d4517691757017be952f230030da96cebc7fe0b48ea86d48b0101d06d7e8f6b5e592a773adfa98f8fa6f1dd111255c381a61592a31
6
+ metadata.gz: 70946062d22034a0a370ed9364cdde7ff9c13855832e405e7955806f768383be95eac3a101b45f43d4f2360f58235209384d1b87128ca72cce16f0cd77f5ebaf
7
+ data.tar.gz: ebffe2fda61381e9bcfccf97c5f430808434bd330c4e96342023c90d9eacf806d7f0036f85471a78181b6e4c8b607c4f22de57d160da4bb8e351c3acedee53af
data/lib/harbr/job.rb CHANGED
@@ -42,23 +42,30 @@ module Harbr
42
42
  def collate_containers(name, host, port, host_header_aliases = [])
43
43
  containers = Harbr::Container::Repository.new
44
44
  container = containers.find_by_header(host)
45
-
46
- host_header_aliases << host
47
-
45
+
48
46
  if container.nil?
49
- host_header_aliases.each do |host_header_alias|
50
- container = Harbr::Container.new
51
- container.name = name
52
- container.host_header = host_header_alias
53
- container.ip = "127.0.0.1"
54
- container.port = port
55
- containers.create(container)
56
- end
47
+ container = Harbr::Container.new
48
+ container.name = name
49
+ container.host_header = host
50
+ container.ip = "127.0.0.1"
51
+ container.port = port
52
+ containers.create(container)
53
+
57
54
  else
58
55
  container.port = port
59
56
  containers.update(container)
60
57
  end
61
58
 
59
+ host_header_aliases.each do |host_header_alias|
60
+ container = Harbr::Container.new
61
+ container.name = "#{name} -> #{host_header_alias}"
62
+ container.host_header = host_header_alias
63
+ container.ip = "127.0.0.1"
64
+ container.port = port
65
+ containers.create(container) unless containers.find_by_header(host_header_alias)
66
+ end
67
+
68
+
62
69
  containers.all
63
70
  end
64
71
 
data/lib/harbr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Harbr
4
- VERSION = "0.1.74"
4
+ VERSION = "0.1.75"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.74
4
+ version: 0.1.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delaney Kuldvee Burke