uffizzi_core 2.2.10 → 2.2.11
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a82783f7a27772ccc8463248c092baa337c91359746d13300b0399e282e7ce
|
4
|
+
data.tar.gz: 0af9485af9df35f0ac7b3e253ec7463cc0b1d7c0303eca45bb341310b80e7d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cca634776180b812c88a671ac5267019d067d713a41b1445381355e4f8ebc3b9aa14a52820e304682e8c33c75977b2ea10849e353edaf4d2232429576e574045
|
7
|
+
data.tar.gz: ff7118194e445877ca4d8d8d42ef2844977a40e60f91ee51ad181e8f0c5bb3a139d666adecb78acdcbb64e10b628ad7a9cdd846ea9af9ef2d83dd9f4e30d2c2a
|
@@ -61,7 +61,7 @@ module UffizziCore::Concerns::Models::Container
|
|
61
61
|
transitions from: [:disabled], to: :active
|
62
62
|
end
|
63
63
|
|
64
|
-
event :disable
|
64
|
+
event :disable do
|
65
65
|
transitions from: [:active], to: :disabled
|
66
66
|
end
|
67
67
|
end
|
@@ -76,10 +76,6 @@ module UffizziCore::Concerns::Models::Container
|
|
76
76
|
public && active?
|
77
77
|
end
|
78
78
|
|
79
|
-
def clean
|
80
|
-
update(public: false, port: nil)
|
81
|
-
end
|
82
|
-
|
83
79
|
def set_defaults
|
84
80
|
update_target_port_value
|
85
81
|
end
|
@@ -1,6 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class UffizziCore::ControllerService
|
4
|
+
class InvalidPublicPort < StandardError
|
5
|
+
def initialize(containers)
|
6
|
+
msg = "Deployment with ID #{containers.first.deployment.id} does not have any public port"
|
7
|
+
|
8
|
+
super(msg)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
class << self
|
5
13
|
include UffizziCore::DependencyInjectionConcern
|
6
14
|
|
@@ -28,6 +36,10 @@ class UffizziCore::ControllerService
|
|
28
36
|
end
|
29
37
|
|
30
38
|
def deploy_containers(deployment, containers)
|
39
|
+
check_any_container_has_public_port(containers) do |exists|
|
40
|
+
UffizziCore::DeploymentService.disable!(deployment) unless exists
|
41
|
+
end
|
42
|
+
|
31
43
|
containers = containers.map do |container|
|
32
44
|
UffizziCore::Controller::DeployContainers::ContainerSerializer.new(container).as_json(include: '**')
|
33
45
|
end
|
@@ -100,6 +112,15 @@ class UffizziCore::ControllerService
|
|
100
112
|
|
101
113
|
private
|
102
114
|
|
115
|
+
def check_any_container_has_public_port(containers)
|
116
|
+
exists = containers.any? { |c| c.port.present? && c.public }
|
117
|
+
yield(exists) if block_given?
|
118
|
+
|
119
|
+
return if exists
|
120
|
+
|
121
|
+
raise InvalidPublicPort.new(containers)
|
122
|
+
end
|
123
|
+
|
103
124
|
def request_events(deployment)
|
104
125
|
controller_client(deployment).deployment_containers_events(deployment_id: deployment.id)
|
105
126
|
end
|
data/lib/uffizzi_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uffizzi_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Thurman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-08-
|
12
|
+
date: 2023-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|