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
Merge requests
!156
Update fabric8
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update fabric8
wetzel/spesb:update-fabric8
into
theodolite-kotlin
Overview
1
Commits
2
Pipelines
0
Changes
20
Merged
Benedikt Wetzel
requested to merge
wetzel/spesb:update-fabric8
into
theodolite-kotlin
4 years ago
Overview
1
Commits
2
Pipelines
0
Changes
20
Expand
This MR updates fabric8 from version 4.1.2 to 5.4.1
Closes
#235 (closed)
Edited
4 years ago
by
Benedikt Wetzel
0
0
Merge request reports
Compare
theodolite-kotlin
version 3
0c070d2b
4 years ago
version 2
f21fdf72
4 years ago
version 1
bca6bb1b
4 years ago
theodolite-kotlin (base)
and
latest version
latest version
0fe325cc
2 commits,
4 years ago
version 3
0c070d2b
3 commits,
4 years ago
version 2
f21fdf72
2 commits,
4 years ago
version 1
bca6bb1b
1 commit,
4 years ago
20 files
+
104
−
130
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
20
Search (e.g. *.vue) (Ctrl+P)
theodolite-quarkus/src/main/kotlin/theodolite/execution/operator/AbstractStateHandler.kt
+
10
−
13
Options
package
theodolite.execution.operator
import
io.fabric8.kubernetes.api.model.HasMetadata
import
io.fabric8.kubernetes.api.model.KubernetesResourceList
import
io.fabric8.kubernetes.api.model.Namespaced
import
io.fabric8.kubernetes.client.CustomResource
import
io.fabric8.kubernetes.client.CustomResourceDoneable
import
io.fabric8.kubernetes.client.CustomResourceList
import
io.fabric8.kubernetes.client.KubernetesClient
import
io.fabric8.kubernetes.client.dsl.MixedOperation
import
io.fabric8.kubernetes.client.dsl.Resource
import
io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext
import
java.lang.Thread.sleep
abstract
class
AbstractStateHandler
<
T
,
L
,
D
>(
private
val
context
:
CustomResourceDefinitionContext
,
private
val
client
:
KubernetesClient
,
private
val
crd
:
Class
<
T
>,
private
val
crdList
:
Class
<
L
>,
private
val
donableCRD
:
Class
<
D
>
):
StateHandler
where
T
:
CustomResource
,
T
:
Namespaced
,
L
:
CustomResourceList
<
T
>,
D
:
CustomResourceDoneable
<
T
>
{
private
val
crdList
:
Class
<
L
>
):
StateHandler
<
T
>
where
T
:
CustomResource
<
*
,
*
>?,
T
:
HasMetadata
,
T
:
Namespaced
,
L
:
KubernetesResourceList
<
T
>
{
private
val
crdClient
:
MixedOperation
<
T
,
L
,
D
,
Resource
<
T
,
D
>>
=
this
.
client
.
customResources
(
this
.
context
,
this
.
crd
,
this
.
crdList
,
this
.
donableCRD
)
private
val
crdClient
:
MixedOperation
<
T
,
L
,
Resource
<
T
>>
=
this
.
client
.
customResources
(
this
.
crd
,
this
.
crdList
)
@Synchronized
override
fun
setState
(
resourceName
:
String
,
f
:
(
CustomResource
)
->
CustomResource
?)
{
override
fun
setState
(
resourceName
:
String
,
f
:
(
T
)
->
T
?)
{
this
.
crdClient
.
inNamespace
(
this
.
client
.
namespace
)
.
list
().
items
.
filter
{
item
->
item
.
metadata
.
name
==
resourceName
}
.
map
{
customResource
->
f
(
customResource
)
}
.
forEach
{
this
.
crdClient
.
updateStatus
(
it
as
T
)
}
.
forEach
{
this
.
crdClient
.
updateStatus
(
it
)
}
}
@Synchronized
override
fun
getState
(
resourceName
:
String
,
f
:
(
CustomResource
)
->
String
?):
String
?
{
override
fun
getState
(
resourceName
:
String
,
f
:
(
T
)
->
String
?):
String
?
{
return
this
.
crdClient
.
inNamespace
(
this
.
client
.
namespace
)
.
list
().
items
@@ -42,7 +39,7 @@ abstract class AbstractStateHandler<T,L,D>(
}
@Synchronized
override
fun
blockUntilStateIsSet
(
resourceName
:
String
,
desiredStatusString
:
String
,
f
:
(
CustomResource
)
->
String
?,
maxTries
:
Int
):
Boolean
{
override
fun
blockUntilStateIsSet
(
resourceName
:
String
,
desiredStatusString
:
String
,
f
:
(
T
)
->
String
?,
maxTries
:
Int
):
Boolean
{
for
(
i
in
0
.
rangeTo
(
maxTries
))
{
val
currentStatus
=
getState
(
resourceName
,
f
)
if
(
currentStatus
==
desiredStatusString
)
{
Loading