uffizzi_core 2.1.24 → 2.1.25
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 891fe1a03e5dd0dbc635156b946213cbedef67a792537d706e7247ec241c8c7a
|
4
|
+
data.tar.gz: a81611e8aa150c0d6bf1ac9f3bdbd549aefdfcfc1434f3ebe68688488bd509b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de4b67a8fc79849717ac31c2e74511d8c017dad1adc70cdc94dc83ab022290c819dfd7cf68fda8b411399ec7b39efd0f774e351daecd25845cc84f82879cf33
|
7
|
+
data.tar.gz: '028258a7a6c4550b9921642df1d38e8ef3e87e63b0f95fefbb866eaf46614df97b114f6bf51fdfa82ff0190ed2abcf910a4602ada23e6850a6ddedbfa1fdd603'
|
@@ -51,6 +51,8 @@ class UffizziCore::Api::Cli::V1::Projects::DeploymentsController < UffizziCore::
|
|
51
51
|
# @response [object<errors: object<title: string>>] 404 Not found
|
52
52
|
# @response 401 Not authorized
|
53
53
|
def create
|
54
|
+
return render_deployment_exists_error if deployments.with_metadata.with_labels(metadata_params).exists?
|
55
|
+
|
54
56
|
compose_file, errors = find_or_create_compose_file
|
55
57
|
return render_invalid_file if compose_file.invalid_file?
|
56
58
|
return render_errors(errors) if errors.present?
|
@@ -193,6 +195,10 @@ class UffizziCore::Api::Cli::V1::Projects::DeploymentsController < UffizziCore::
|
|
193
195
|
end
|
194
196
|
|
195
197
|
def render_invalid_file
|
196
|
-
render json: { errors: { state: ['
|
198
|
+
render json: { errors: { state: [I18n.t('compose.invalid_compose')] } }, status: :unprocessable_entity
|
199
|
+
end
|
200
|
+
|
201
|
+
def render_deployment_exists_error
|
202
|
+
render json: { errors: { state: [I18n.t('deployment.already_exists')] } }, status: :unprocessable_entity
|
197
203
|
end
|
198
204
|
end
|
@@ -12,7 +12,7 @@ module UffizziCore::DeploymentRepo
|
|
12
12
|
scope :active_for_credential_id, ->(credential_id) {
|
13
13
|
active.joins(project: :credentials).merge(UffizziCore::Project.active).where(credentials: { id: credential_id })
|
14
14
|
}
|
15
|
-
|
15
|
+
scope :with_metadata, -> { where.not(metadata: {}) }
|
16
16
|
scope :with_labels, ->(labels) {
|
17
17
|
where("#{UffizziCore::Deployment.table_name}.metadata @> ?", labels.to_json)
|
18
18
|
}
|
data/config/locales/en.yml
CHANGED
@@ -14,6 +14,7 @@ en:
|
|
14
14
|
compose:
|
15
15
|
unsupported_file: Unsupported compose file
|
16
16
|
invalid_file: 'Syntax error: %{err} at line %{line} column %{column}'
|
17
|
+
invalid_compose: Invalid compose file
|
17
18
|
invalid_config_option: Invalid config option '%{value}' - only a-zA-Z0-9._- characters are allowed
|
18
19
|
no_services: Service services has neither an image nor a build context specified. At least one must be provided.
|
19
20
|
invalid_service_name: "Invalid service name '%{value}': a service name must consist of lower case alphanumeric characters, ''-'', and must start and end with an alphanumeric character"
|
@@ -80,6 +81,7 @@ en:
|
|
80
81
|
|
81
82
|
deployment:
|
82
83
|
invalid_state: Preview with ID deployment-%{id} %{state}
|
84
|
+
already_exists: An active deployment already exists
|
83
85
|
|
84
86
|
session:
|
85
87
|
unsupported_login_type: This type of login is not supported
|
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.1.
|
4
|
+
version: 2.1.25
|
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-
|
12
|
+
date: 2023-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aasm
|