uffizzi_core 0.3.2 → 0.3.3

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: 4b8ca3af8c38a71fa5553b167c12e7e687798301b53e49763842060c9e84e5cf
4
- data.tar.gz: 540f925f4a4670f28aba1cc733b8d2e5e583505fb0e41de48d08106fac683204
3
+ metadata.gz: '0995e3de000730f4d7d9efeeb62415e374f4d58569b31a60db5faffa99f58453'
4
+ data.tar.gz: 53ea793138e8229747e1462156a158e0c4114130c03c7a7eb7993d66e07f472f
5
5
  SHA512:
6
- metadata.gz: 3c8d5d89bb09311641a0a15a372a5bc27bd9dc61e5f5d13a648eb9f3285e602600ac32bc60ec0cc7bfef129fa495f2c9e5b7cbefa98397386fb642a1bba214cd
7
- data.tar.gz: 8d388c411e83d1e9d9da2c92c8dde788a5212c398e2c8a44aec41392a4034c0ce2b5d8e88659f3c9bdfb94e4c1f48dd369a87c68e11defa849449823161a51cb
6
+ metadata.gz: cdba3364a0821713bb040dc31192fcbac362aea072ae0865d5353576b0428ee7aeada4fcdd15733dfdef340e0c49bd9055f07752a712f7c0063d3dd4cc396c88
7
+ data.tar.gz: 3fec15634e8fc1e9de9eea24b2b913832633cba55065390ee22141f80a22290d31d50c30a9f998ff2d0cd90d023d45a0f3ad7fc0dd111d84d7235111e63c4882
@@ -5,7 +5,7 @@ class UffizziCore::ConfigFile::ApplyJob < UffizziCore::ApplicationJob
5
5
 
6
6
  sidekiq_retry_in do |count, exception|
7
7
  case exception
8
- when UffizziCore::ControllerService::DeploymentNotFoundError
8
+ when UffizziCore::DeploymentNotFoundError
9
9
  Rails.logger.info("DEPLOYMENT_PROCESS ApplyJob retry deployment_id=#{exception.deployment_id} count=#{count}")
10
10
  Settings.controller.resource_create_retry_time
11
11
  end
@@ -22,7 +22,7 @@ class UffizziCore::ConfigFile::ApplyJob < UffizziCore::ApplicationJob
22
22
  end
23
23
 
24
24
  unless UffizziCore::ControllerService.deployment_exists?(deployment)
25
- raise UffizziCore::ControllerService::DeploymentNotFoundError,
25
+ raise UffizziCore::DeploymentNotFoundError,
26
26
  deployment_id
27
27
  end
28
28
 
@@ -57,6 +57,7 @@ module UffizziCore::Concerns::Models::Deployment
57
57
 
58
58
  def after_disable
59
59
  clean
60
+ update!(disabled_at: Time.now)
60
61
  end
61
62
 
62
63
  def after_fail
@@ -49,13 +49,13 @@ class UffizziCore::DockerHubService
49
49
  end
50
50
 
51
51
  def user_client(credential)
52
- if @client.nil?
53
- @client = UffizziCore::DockerHubClient.new(credential)
52
+ return @client if @client&.credential&.username == credential.username
54
53
 
55
- unless @client.authentificated?
56
- Rails.logger.warn("broken credentials, DockerHubService credential_id=#{credential.id}")
57
- credential.unauthorize! unless credential.unauthorized?
58
- end
54
+ @client = UffizziCore::DockerHubClient.new(credential)
55
+
56
+ unless @client.authentificated?
57
+ Rails.logger.warn("broken credentials, DockerHubService credential_id=#{credential.id}")
58
+ credential.unauthorize! unless credential.unauthorized?
59
59
  end
60
60
 
61
61
  @client
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddDisabledAtToDeployments < ActiveRecord::Migration[6.1]
4
+ def up
5
+ change_table :uffizzi_core_deployments do |t|
6
+ t.datetime :disabled_at
7
+ end
8
+ UffizziCore::Deployment.disabled.update_all('disabled_at = updated_at')
9
+ end
10
+
11
+ def down
12
+ change_table :uffizzi_core_deployments do |t|
13
+ t.remove :disabled_at
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.3'
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: 0.3.2
4
+ version: 0.3.3
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: 2022-07-18 00:00:00.000000000 Z
12
+ date: 2022-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm
@@ -957,6 +957,7 @@ files:
957
957
  - db/migrate/20220419074956_add_health_check_to_containers.rb
958
958
  - db/migrate/20220422151523_add_volumes_to_uffizzi_core_containers.rb
959
959
  - db/migrate/20220525113412_rename_name_to_uffizzi_containers.rb
960
+ - db/migrate/20220704135629_add_disabled_at_to_deployments.rb
960
961
  - db/seeds.rb
961
962
  - lib/tasks/uffizzi_core_tasks.rake
962
963
  - lib/uffizzi_core.rb