uffizzi_core 2.2.10 → 2.2.12
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f772c9b87543e9235c6d874a0b51976de68bc59ce4df268431cedeed2ad591b4
|
4
|
+
data.tar.gz: 9cae54ffd97d0d1168a7421fa9bc982cb60ada19024559f9e3a9de4de52e9fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c13d3b51c33532ba74b12fe34c4ec87f2b0de01fc3d135ab85568dca91440866b87bc24a8b6556a541bf78988e7405bc24909504873ca7d1bcce82d79bc3931a
|
7
|
+
data.tar.gz: afd0851814b2b0509f83b4c84c2739077b2bfbc073f31fe6db15e88bec6272d3bc2c74af1ce6bdc3b756c002b5a1572382894f3ce7850c6ba886b18e658de24e
|
@@ -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.12
|
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
|