uffizzi_core 2.2.13 → 2.2.16

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: f4baf35fa4882486818d0dafd7657dfd5d4f7eac15a95cd5932d4925d514552d
4
- data.tar.gz: 9ab10a0a45f5d6de5a90b7ea2f04e7b4084cfd33c5e3dd55d717f7619febbb94
3
+ metadata.gz: 7aeb2490e838cc774c8abea9c3fcba1264d367916b16326844e42e7c95c33b99
4
+ data.tar.gz: 511f4027d656c51f96043f15c427fcf7fa9e47b199446dc33415fa35e51e734c
5
5
  SHA512:
6
- metadata.gz: e6cfc397ede0f4c943fe470b734632d8fd1fc826195ab6e3f940b2102baa6f2cabee661909a4a18424ea7aed01c225e51e68bca312f9f053a81107344fc4bcff
7
- data.tar.gz: '09c64f4d156ba5a4ad97f4f9821fb11398b25b3238566b8ef0801b632f281010fae2530442558f2c67c6f10035e6aabcf07265b978c77b6bcb66cbdcdd6fd22b'
6
+ metadata.gz: '0950a88eeea3a7f949777d8f759d9d784e46dbf9e0650dd50aa2db38682967c2adb1e6b1eba626e1220c61eb86075a8ec50379b89f0427ba83d732dda99cc91e'
7
+ data.tar.gz: d9e10ef11020d139d03e8091e7def3951a73f5ad849bb9df1c3422522613bbb42c03b404ed29acbb5707bd293040c9928ec0dc6a2b9cac4d2dbc5c4d19a89019
@@ -50,6 +50,9 @@ class UffizziCore::Api::Cli::V1::Accounts::CredentialsController < UffizziCore::
50
50
  # @response [object<errors>] 422 Unprocessable entity
51
51
  def update
52
52
  credential = resource_account.credentials.find_by!(type: params[:type])
53
+ # Called every pipeline run from CLI with the --update-if-exists-option
54
+ return respond_with credential unless credential_changed?(credential, credential_params)
55
+
53
56
  credential_form = credential.becomes(UffizziCore::Api::Cli::V1::Account::Credential::UpdateForm)
54
57
  credential_form.assign_attributes(credential_params)
55
58
 
@@ -109,4 +112,10 @@ class UffizziCore::Api::Cli::V1::Accounts::CredentialsController < UffizziCore::
109
112
  credential_form.registry_url
110
113
  end
111
114
  end
115
+
116
+ def credential_changed?(credential, credential_params)
117
+ credential.password != credential_params[:password] ||
118
+ credential.username != credential_params[:username] ||
119
+ credential.registry_url != credential_params[:registry_url]
120
+ end
112
121
  end
@@ -3,7 +3,7 @@
3
3
  class UffizziCore::Api::Cli::V1::Cluster::CreateForm < UffizziCore::Cluster
4
4
  include UffizziCore::ApplicationForm
5
5
 
6
- permit :name, :manifest
6
+ permit :name, :manifest, :creation_source
7
7
 
8
8
  validate :check_manifest, if: -> { manifest.present? }
9
9
 
@@ -8,6 +8,7 @@ module UffizziCore::Concerns::Models::Cluster
8
8
 
9
9
  included do
10
10
  include AASM
11
+ extend Enumerize
11
12
 
12
13
  self.table_name = UffizziCore.table_names[:clusters]
13
14
 
@@ -16,6 +17,10 @@ module UffizziCore::Concerns::Models::Cluster
16
17
  validates_uniqueness_of :name, conditions: -> { enabled }, scope: :project_id
17
18
  validates :name, presence: true, format: { with: /\A[a-zA-Z0-9-]*\z/ }
18
19
 
20
+ enumerize :creation_source, in: UffizziCore.cluster_creation_sources, scope: true, predicates: true
21
+ attribute :creation_source, :string, default: :manual
22
+ validates :creation_source, presence: true
23
+
19
24
  aasm(:state) do
20
25
  state :deploying_namespace, initial: true
21
26
  state :failed_deploy_namespace
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddSourceToUffizziCoreClusters < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_column(:uffizzi_core_clusters, :creation_source, :string)
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.2.13'
4
+ VERSION = '2.2.16'
5
5
  end
data/lib/uffizzi_core.rb CHANGED
@@ -72,4 +72,5 @@ module UffizziCore
72
72
  mattr_accessor :account_sources, default: [:manual]
73
73
  mattr_accessor :compose_file_kinds, default: [:main, :temporary]
74
74
  mattr_accessor :event_states, default: [:waiting, :queued, :successful, :deployed, :failed, :building, :timeout, :cancelled, :deploying]
75
+ mattr_accessor :cluster_creation_sources, default: [:manual]
75
76
  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.13
4
+ version: 2.2.16
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-17 00:00:00.000000000 Z
12
+ date: 2023-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm
@@ -1082,6 +1082,7 @@ files:
1082
1082
  - db/migrate/20230531135739_create_deployment_events.rb
1083
1083
  - db/migrate/20230613101901_create_clusters.rb
1084
1084
  - db/migrate/20230711101901_add_host_to_clusters.rb
1085
+ - db/migrate/20230810140316_add_source_to_uffizzi_core_clusters.rb
1085
1086
  - db/seeds.rb
1086
1087
  - lib/tasks/uffizzi_core_tasks.rake
1087
1088
  - lib/uffizzi_core.rb