uffizzi_core 2.3.2 → 2.4.1

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: 81b82f01fa3b61eea7546716b1d7bd696ada00810ab5ce6ca72bc6c609bb7266
4
- data.tar.gz: da50fab31a969b5169a8025034603fb9500dc40c220a17a8fb98667f4ed14f3e
3
+ metadata.gz: 2132ab2650112542b20ad1d7710dd70927e4e5b2847ecfc22b095776a7839cfd
4
+ data.tar.gz: 139b01b159ccf2a464109277a2bedefac4b95cbd7d3dd8f5ccbe6a8192a12bd7
5
5
  SHA512:
6
- metadata.gz: e2116c59a1f5d6f49f76bc08506e55a67bf7a8ebd4d38d5288f0d6f7664d36182206e30d33c42d88909ac7b9510122df3aa2c38cd6fd3ad6137640e213fb6a5d
7
- data.tar.gz: 3573e168fe9af86a4d49b38b0d416cf856434c1d6a2d04ff7d1634f1947e3b25d0a34fdd72366c1f7b0e173d6a4718ed453e5f1c744b9d52a2b2e1a19c4bb360
6
+ metadata.gz: b0757185b908b94ac4c64288367810c58b0684f2d8cabc982d05182819d15608f40932cae3982e617887c0b34ee56193e45ca35a44edf7c83c7ce6c3cd6545ac
7
+ data.tar.gz: c419911fce7cc72693f13d4b98b7c429a99c81bb163ff3f4034b4ee2cb7877acec6efa1e29cc667c5ac6bd4844fdeef70b4087635505388bf960fd25c0a6da76
@@ -60,6 +60,14 @@ class UffizziCore::Api::Cli::V1::Projects::ClustersController < UffizziCore::Api
60
60
  respond_with resource_cluster
61
61
  end
62
62
 
63
+ def sync
64
+ cluster_form = resource_cluster.becomes(UffizziCore::Api::Cli::V1::Cluster::SyncForm)
65
+ cluster_form.sync_status
66
+ cluster_form.save
67
+
68
+ respond_with cluster_form
69
+ end
70
+
63
71
  def destroy
64
72
  resource_cluster.disable!
65
73
 
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ class UffizziCore::Api::Cli::V1::Cluster::SyncForm < UffizziCore::Cluster
4
+ include UffizziCore::ApplicationForm
5
+
6
+ permit :state
7
+
8
+ def sync_status
9
+ cluster_data = UffizziCore::ControllerService.show_cluster(self)
10
+
11
+ asleep_in_cluster = cluster_data.status.sleep
12
+ return unless deployed? || scaled_down?
13
+ return if actual_status?(asleep_in_cluster)
14
+
15
+ self.state = asleep_in_cluster ? UffizziCore::Cluster::STATE_SCALED_DOWN : UffizziCore::Cluster::STATE_DEPLOYED
16
+
17
+ self
18
+ end
19
+
20
+ private
21
+
22
+ def actual_status?(asleep_in_cluster)
23
+ (asleep_in_cluster && scaled_down?) || (!asleep_in_cluster && deployed?)
24
+ end
25
+ end
@@ -21,6 +21,10 @@ class UffizziCore::Api::Cli::V1::Projects::ClustersPolicy < UffizziCore::Applica
21
21
  context.user_access_module.admin_or_developer_access_to_project?(context.user, context.project)
22
22
  end
23
23
 
24
+ def sync?
25
+ context.user_access_module.admin_or_developer_access_to_project?(context.user, context.project)
26
+ end
27
+
24
28
  def destroy?
25
29
  context.user_access_module.admin_or_developer_access_to_project?(context.user, context.project)
26
30
  end
data/config/routes.rb CHANGED
@@ -14,6 +14,7 @@ UffizziCore::Engine.routes.draw do
14
14
  member do
15
15
  put :scale_down
16
16
  put :scale_up
17
+ put :sync
17
18
  end
18
19
  scope module: :clusters do
19
20
  resources :ingresses, only: ['index']
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.3.2'
4
+ VERSION = '2.4.1'
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.3.2
4
+ version: 2.4.1
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-12-05 00:00:00.000000000 Z
12
+ date: 2023-12-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm
@@ -821,6 +821,7 @@ files:
821
821
  - app/forms/uffizzi_core/api/cli/v1/account/credential/create_form.rb
822
822
  - app/forms/uffizzi_core/api/cli/v1/account/credential/update_form.rb
823
823
  - app/forms/uffizzi_core/api/cli/v1/cluster/create_form.rb
824
+ - app/forms/uffizzi_core/api/cli/v1/cluster/sync_form.rb
824
825
  - app/forms/uffizzi_core/api/cli/v1/compose_file/check_credentials_form.rb
825
826
  - app/forms/uffizzi_core/api/cli/v1/compose_file/cli_form.rb
826
827
  - app/forms/uffizzi_core/api/cli/v1/compose_file/create_form.rb