Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
37535e44
Commit
37535e44
authored
3 years ago
by
Benedikt Wetzel
Browse files
Options
Downloads
Patches
Plain Diff
reformat code
parent
8de1752e
No related branches found
No related tags found
1 merge request
!201
Introduce action commands
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt
+4
-6
4 additions, 6 deletions
...ite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt
with
4 additions
and
6 deletions
theodolite/src/main/kotlin/theodolite/benchmark/ActionCommand.kt
+
4
−
6
View file @
37535e44
...
...
@@ -8,10 +8,8 @@ import okhttp3.Response
import
theodolite.util.ActionCommandFailedException
import
java.io.ByteArrayOutputStream
import
java.time.Duration
import
java.util.concurrent.CompletableFuture
import
java.util.concurrent.CountDownLatch
import
java.util.concurrent.TimeUnit
import
javax.imageio.ImageTranscoder
import
kotlin.properties.Delegates
private
val
logger
=
KotlinLogging
.
logger
{}
...
...
@@ -31,7 +29,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) {
* @param command The command to be executed.
* @return
*/
fun
exec
(
matchLabels
:
MutableMap
<
String
,
String
>,
command
:
String
,
container
:
String
=
""
):
Int
{
fun
exec
(
matchLabels
:
MutableMap
<
String
,
String
>,
command
:
String
,
container
:
String
=
""
):
Int
{
val
exitCode
=
ExitCode
()
...
...
@@ -70,7 +68,7 @@ class ActionCommand(val client: NamespacedKubernetesClient) {
for
(
i
in
1
..
tries
)
{
try
{
return
getPodName
(
matchLabels
)
return
getPodName
(
matchLabels
)
}
catch
(
e
:
Exception
)
{
logger
.
warn
{
"Could not found any pod with specified matchlabels or pod is not ready."
}
}
...
...
@@ -80,13 +78,13 @@ class ActionCommand(val client: NamespacedKubernetesClient) {
}
private
fun
getPodName
(
matchLabels
:
MutableMap
<
String
,
String
>):
String
{
return
try
{
return
try
{
val
podNames
=
this
.
client
.
pods
()
.
withLabels
(
matchLabels
)
.
list
()
.
items
.
map
{
it
.
metadata
.
name
}
.
map
{
it
.
metadata
.
name
}
podNames
.
first
{
this
.
client
.
pods
().
withName
(
it
).
isReady
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment