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
becfb5e9
Commit
becfb5e9
authored
4 years ago
by
Lorenz Boguhn
Browse files
Options
Downloads
Patches
Plain Diff
Refactor
parent
e4646677
No related branches found
No related tags found
4 merge requests
!159
Re-implementation of Theodolite with Kotlin/Quarkus
,
!157
Update Graal Image in CI pipeline
,
!83
WIP: Re-implementation of Theodolite with Kotlin/Quarkus
,
!78
Resolve "Implement Quarkus/Kotlin protype"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theodolite-quarkus/src/main/kotlin/theodolite/ServiceManager.kt
+1
-1
1 addition, 1 deletion
...lite-quarkus/src/main/kotlin/theodolite/ServiceManager.kt
theodolite-quarkus/src/main/kotlin/theodolite/YamlLoader.kt
+22
-2
22 additions, 2 deletions
theodolite-quarkus/src/main/kotlin/theodolite/YamlLoader.kt
with
23 additions
and
3 deletions
theodolite-quarkus/src/main/kotlin/theodolite/ServiceManager.kt
+
1
−
1
View file @
becfb5e9
...
@@ -4,7 +4,7 @@ import io.fabric8.kubernetes.api.model.Service
...
@@ -4,7 +4,7 @@ import io.fabric8.kubernetes.api.model.Service
import
io.fabric8.kubernetes.client.NamespacedKubernetesClient
import
io.fabric8.kubernetes.client.NamespacedKubernetesClient
class
ServiceManager
(
client
:
NamespacedKubernetesClient
)
{
class
ServiceManager
(
client
:
NamespacedKubernetesClient
)
{
lateinit
var
client
:
NamespacedKubernetesClient
var
client
:
NamespacedKubernetesClient
init
{
init
{
this
.
client
=
client
this
.
client
=
client
...
...
This diff is collapsed.
Click to expand it.
theodolite-quarkus/src/main/kotlin/theodolite/YamlLoader.kt
+
22
−
2
View file @
becfb5e9
...
@@ -9,29 +9,49 @@ import mu.KotlinLogging
...
@@ -9,29 +9,49 @@ import mu.KotlinLogging
private
val
logger
=
KotlinLogging
.
logger
{}
private
val
logger
=
KotlinLogging
.
logger
{}
class
YamlLoader
(
client
:
NamespacedKubernetesClient
)
{
class
YamlLoader
(
client
:
NamespacedKubernetesClient
)
{
lateinit
var
client
:
NamespacedKubernetesClient
var
client
:
NamespacedKubernetesClient
init
{
init
{
this
.
client
=
client
this
.
client
=
client
}
}
/**
* Parses a Service from a servive yaml
* @param path of the yaml file
* @return service from fabric8
*/
fun
loadService
(
path
:
String
):
Service
?
{
fun
loadService
(
path
:
String
):
Service
?
{
val
service
=
loadGenericRessource
(
path
,
{
x
:
String
->
client
.
services
().
load
(
x
).
get
()
})
val
service
=
loadGenericRessource
(
path
,
{
x
:
String
->
client
.
services
().
load
(
x
).
get
()
})
return
service
return
service
}
}
/**
* Parses a Deployment from a Deployment yaml
* @param path of the yaml file
* @return Deployment from fabric8
*/
fun
loadDeployment
(
path
:
String
):
Deployment
?
{
fun
loadDeployment
(
path
:
String
):
Deployment
?
{
val
deployment
=
loadGenericRessource
(
path
,
{
x
:
String
->
client
.
apps
().
deployments
().
load
(
x
).
get
()
})
val
deployment
=
loadGenericRessource
(
path
,
{
x
:
String
->
client
.
apps
().
deployments
().
load
(
x
).
get
()
})
return
deployment
return
deployment
}
}
/**
* Parses a ConfigMap from a ConfigMap yaml
* @param path of the yaml file
* @return ConfigMap from fabric8
*/
fun
loadConfigmap
(
path
:
String
):
ConfigMap
?
{
fun
loadConfigmap
(
path
:
String
):
ConfigMap
?
{
val
configMap
=
loadGenericRessource
(
path
,
{
x
:
String
->
client
.
configMaps
().
load
(
x
).
get
()
})
val
configMap
=
loadGenericRessource
(
path
,
{
x
:
String
->
client
.
configMaps
().
load
(
x
).
get
()
})
return
configMap
return
configMap
}
}
fun
<
T
>
loadGenericRessource
(
path
:
String
,
f
:
(
String
)
->
T
):
T
?
{
/**
* Generic helper function to load a resource.
* @param path of the resource
* @param f fuction that shall be applied to the resource.
*/
private
fun
<
T
>
loadGenericRessource
(
path
:
String
,
f
:
(
String
)
->
T
):
T
?
{
var
resource
:
T
?
=
null
var
resource
:
T
?
=
null
try
{
try
{
...
...
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