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 +4 -4
- data/app/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller.rb +8 -0
- data/app/forms/uffizzi_core/api/cli/v1/cluster/sync_form.rb +25 -0
- data/app/policies/uffizzi_core/api/cli/v1/projects/clusters_policy.rb +4 -0
- data/config/routes.rb +1 -0
- data/lib/uffizzi_core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2132ab2650112542b20ad1d7710dd70927e4e5b2847ecfc22b095776a7839cfd
|
4
|
+
data.tar.gz: 139b01b159ccf2a464109277a2bedefac4b95cbd7d3dd8f5ccbe6a8192a12bd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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.
|
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-
|
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
|