Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alp Deniz Ogut
Pod
Commits
421bf1eb
Unverified
Commit
421bf1eb
authored
3 years ago
by
Vasili Novikov
Browse files
Options
Download
Email Patches
Plain Diff
Fix json usage
parent
1d7f7dbb
dev
bulk_log_created_edges
cache-fix
ci-cd-clean
ci-cd-new
fix-gitlab-ci-caching
fix_run_development
graphQL-prototype
graphQL-prototype-iter
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugin_run.rs
+9
-9
src/plugin_run.rs
with
9 additions
and
9 deletions
+9
-9
src/plugin_run.rs
+
9
-
9
View file @
421bf1eb
...
...
@@ -30,15 +30,15 @@ pub fn run_plugin_container(
"Trying to run plugin container for target_item_id {}"
,
target_item_id
);
let
item
=
internal_api
::
get_item_tx
(
tx
,
schema
,
target_item_id
)
?
;
let
item
=
item
.into_iter
()
.next
()
.ok_or_else
(||
Error
{
let
target_
item
=
internal_api
::
get_item_tx
(
tx
,
schema
,
target_item_id
)
?
;
let
target_item
=
target_
item
.into_iter
()
.next
()
.ok_or_else
(||
Error
{
code
:
StatusCode
::
BAD_REQUEST
,
msg
:
format!
(
"Failed to find target item {} to run a plugin against"
,
target_item_id
),
})
?
;
let
item
=
serde_json
::
to_string
(
&
item
)
?
;
let
target_item_json
=
serde_json
::
to_string
(
&
target_
item
)
?
;
let
auth
=
database_key
.create_plugin_auth
()
?
;
let
auth
=
serde_json
::
to_string
(
&
auth
)
?
;
let
container_id
=
format!
(
...
...
@@ -51,7 +51,7 @@ pub fn run_plugin_container(
run_kubernetes_container
(
&
container_image
,
container_id
,
&
target_item_
id
,
&
target_item_
json
,
pod_owner
,
&
auth
,
triggered_by_item_id
,
...
...
@@ -61,7 +61,7 @@ pub fn run_plugin_container(
run_docker_container
(
&
container_image
,
container_id
,
&
target_item_
id
,
&
target_item_
json
,
pod_owner
,
&
auth
,
triggered_by_item_id
,
...
...
@@ -84,7 +84,7 @@ pub fn run_plugin_container(
fn
run_docker_container
(
container_image
:
&
str
,
container_id
:
String
,
target_item
:
&
str
,
target_item
_json
:
&
str
,
pod_owner
:
&
str
,
pod_auth
:
&
str
,
triggered_by_item_id
:
&
str
,
...
...
@@ -101,7 +101,7 @@ fn run_docker_container(
"--env=POD_FULL_ADDRESS={}"
,
callback_address
(
cli_options
)
));
args
.push
(
format!
(
"--env=POD_TARGET_ITEM={}"
,
target_item
));
args
.push
(
format!
(
"--env=POD_TARGET_ITEM={}"
,
target_item
_json
));
args
.push
(
format!
(
"--env=POD_PLUGINRUN_ID={}"
,
triggered_by_item_id
));
args
.push
(
format!
(
"--env=POD_OWNER={}"
,
pod_owner
));
args
.push
(
format!
(
"--env=POD_AUTH_JSON={}"
,
pod_auth
));
...
...
@@ -122,7 +122,7 @@ fn run_docker_container(
fn
run_kubernetes_container
(
container_image
:
&
str
,
container_id
:
String
,
target_item
:
&
str
,
target_item
_json
:
&
str
,
pod_owner
:
&
str
,
pod_auth
:
&
str
,
triggered_by_item_id
:
&
str
,
...
...
@@ -136,7 +136,7 @@ fn run_kubernetes_container(
"--env=POD_FULL_ADDRESS={}"
,
callback_address
(
cli_options
)
));
args
.push
(
format!
(
"--env=POD_TARGET_ITEM={}"
,
target_item
));
args
.push
(
format!
(
"--env=POD_TARGET_ITEM={}"
,
target_item
_json
));
args
.push
(
format!
(
"--env=POD_PLUGINRUN_ID={}"
,
triggered_by_item_id
));
args
.push
(
format!
(
"--env=POD_OWNER={}"
,
pod_owner
));
args
.push
(
format!
(
"--env=POD_AUTH_JSON={}"
,
pod_auth
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets