uffizzi_core 2.1.22 → 2.1.24

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: 8e656eb503e61d1df06ee0fa3e494ebe2e0710bf332813c7a5d48b0915e297da
4
- data.tar.gz: dd6bc21422c286a60b7ee6f5b42ee476583b9e0240ef5d7c49be8f1fa7150d52
3
+ metadata.gz: de321ff2e21c9c9b909b4739eb07728d4399801c45d267c5608142d2634f519f
4
+ data.tar.gz: 4550ded63ea25d6a480c0e9a93964285746fae2d6582e73bb6829eb3a18e9163
5
5
  SHA512:
6
- metadata.gz: be971d5693d19dc437775321a5897e00abed51e1c3f88878c9370afcbf0accbe90a989002ab75ad18b9eed96cbb4a5c98da80daef57e9042f1c3ac153fb60e24
7
- data.tar.gz: 8b771df5c0456e872d3cb89e9f947962b91ab216493193cf95eaf8e711f1d86f923ad1231b4d59ea15b464c47788192c7db44c97dc97d1e467d10a131626bfb4
6
+ metadata.gz: 3de13bddf08f86c9eb18e7d21b4ccd9ce074815a6716888357f3b93f99f4ed92da9be571296897240f7245e4f4709ff7fd183aab70a915072c15932cd00cae4e
7
+ data.tar.gz: 8634b6e9021ec0f1a5fa883957a91ddbaa4e367e3d2f0b97da4a108c4b935c552bfb944dd6156ef06fb075395904e3d6ed69b59ea15b7af7611daed24a8b39d5
@@ -1,6 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore::DependencyInjectionConcern
4
+ extend ActiveSupport::Concern
5
+
6
+ class_methods do
7
+ def include_module_if_exists(module_name)
8
+ include(Object.const_get(module_name)) if Object.const_defined?(module_name)
9
+ end
10
+ end
11
+
4
12
  def user_access_module
5
13
  return unless module_exists?(:rbac)
6
14
 
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class UffizziCore::Api::Cli::V1::Projects::DeploymentSerializer < UffizziCore::BaseSerializer
4
+ include UffizziCore::DependencyInjectionConcern
5
+ include_module_if_exists('UffizziCore::Api::Cli::V1::Projects::DeploymentSerializerModule')
6
+
4
7
  type :deployment
5
8
 
6
9
  attributes :id,
@@ -45,18 +45,16 @@ class UffizziCore::ActivityItemService
45
45
  deployment = container.deployment
46
46
  service = UffizziCore::ManageActivityItemsService.new(deployment)
47
47
  container_status_item = service.container_status_item(container)
48
+ return if container_status_item.nil?
49
+
48
50
  status = container_status_item[:status]
49
51
  last_event = activity_item.events.order_by_id.last
50
-
51
52
  activity_item.events.create(state: status) if last_event&.state != status
52
53
 
53
- if failed?(status)
54
- UffizziCore::ActivityItemService.fail_deployment!(activity_item)
55
- notification_module.notify_about_failed_deployment(deployment) if notification_module.present?
56
- end
54
+ return handle_failed_status(activity_item, deployment) if failed?(status)
57
55
 
58
56
  if deployed?(status) && UffizziCore::ContainerService.ingress_container?(container)
59
- deployment.update(last_deploy_at: last_event.created_at)
57
+ return deployment.update(last_deploy_at: last_event.created_at)
60
58
  end
61
59
 
62
60
  return unless [UffizziCore::Event.state.building, UffizziCore::Event.state.deploying].include?(status)
@@ -66,6 +64,11 @@ class UffizziCore::ActivityItemService
66
64
 
67
65
  private
68
66
 
67
+ def handle_failed_status(activity_item, deployment)
68
+ UffizziCore::ActivityItemService.fail_deployment!(activity_item)
69
+ notification_module.notify_about_failed_deployment(deployment) if notification_module.present?
70
+ end
71
+
69
72
  def create_item!(activity_item_attributes)
70
73
  activity_item = UffizziCore::ActivityItem.find_by(activity_item_attributes)
71
74
  return activity_item unless completed?(activity_item)
@@ -37,6 +37,9 @@ class UffizziCore::ContainerRegistry::DockerHubService
37
37
  token = docker_hub_client.get_token(image).result.token
38
38
  response = docker_hub_client.digest(image: image, tag: tag, token: token)
39
39
  response.headers['docker-content-digest']
40
+ # FIXME: can't get digest for private image: {"code":"UNAUTHORIZED","message":"authentication required"...}
41
+ rescue UffizziCore::ContainerRegistryError
42
+ 'unknown'
40
43
  end
41
44
 
42
45
  def credential_correct?(credential)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.1.22'
4
+ VERSION = '2.1.24'
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.1.22
4
+ version: 2.1.24
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-05-10 00:00:00.000000000 Z
12
+ date: 2023-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm