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: 9419a80d61cb906e699b4096f7ed6f10fc01f32a6718a977c38387d04af04cb9
4
- data.tar.gz: 279eda26ef9283fc173d93f5b7fc166780ffaa51e2dd83b0be7fbea1ba7862cc
3
+ metadata.gz: 69a82783f7a27772ccc8463248c092baa337c91359746d13300b0399e282e7ce
4
+ data.tar.gz: 0af9485af9df35f0ac7b3e253ec7463cc0b1d7c0303eca45bb341310b80e7d85
5
5
  SHA512:
6
- metadata.gz: 646d0199efbd24eddd77def2b0f8a629e16f81b3f6f871a9961b2cde46f37b5609fbc6662eec3f5e74e74a879ddba1cf504776a767c738ab8127eb28a555e9a5
7
- data.tar.gz: 98c028198257d7bd268b4c6bfaa7a6663be35530f6ed1218d2108e7d6602a43122538a6c54cec92d5ff0d7c247d2e6f1a50a32885600e43a13554a15d514235a
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, after: :clean do
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.2.10'
4
+ VERSION = '2.2.11'
5
5
  end
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.10
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-09 00:00:00.000000000 Z
12
+ date: 2023-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm