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
1415ee4f
Commit
1415ee4f
authored
3 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Remove CustomResourceWrapper class
parent
0fca986f
No related branches found
No related tags found
1 merge request
!257
Allow Theodolite to deploy arbitrary resources
Pipeline
#7077
passed
3 years ago
Stage: build
Stage: test
Stage: check
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theodolite/src/main/kotlin/theodolite/k8s/CustomResourceWrapper.kt
+0
-48
0 additions, 48 deletions
...e/src/main/kotlin/theodolite/k8s/CustomResourceWrapper.kt
with
0 additions
and
48 deletions
theodolite/src/main/kotlin/theodolite/k8s/CustomResourceWrapper.kt
deleted
100644 → 0
+
0
−
48
View file @
0fca986f
package
theodolite.k8s
import
io.fabric8.kubernetes.api.model.KubernetesResource
import
io.fabric8.kubernetes.client.NamespacedKubernetesClient
import
io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext
import
mu.KotlinLogging
private
val
logger
=
KotlinLogging
.
logger
{}
@Deprecated
(
""
)
class
CustomResourceWrapper
(
val
crAsMap
:
Map
<
String
,
String
>,
private
val
context
:
CustomResourceDefinitionContext
)
:
KubernetesResource
{
/**
* Deploy a service monitor
*
* @param client a namespaced Kubernetes client which are used to deploy the CR object.
*
* @throws java.io.IOException if the resource could not be deployed.
*/
fun
deploy
(
client
:
NamespacedKubernetesClient
)
{
client
.
customResource
(
this
.
context
)
.
createOrReplace
(
client
.
configuration
.
namespace
,
this
.
crAsMap
as
Map
<
String
,
Any
>)
}
/**
* Delete a service monitor
*
* @param client a namespaced Kubernetes client which are used to delete the CR object.
*/
fun
delete
(
client
:
NamespacedKubernetesClient
)
{
try
{
client
.
customResource
(
this
.
context
)
.
delete
(
client
.
configuration
.
namespace
,
this
.
getName
())
}
catch
(
e
:
Exception
)
{
logger
.
warn
{
"Could not delete custom resource"
}
}
}
/**
* @throws NullPointerException if name or metadata is null
*/
fun
getName
():
String
{
val
metadataAsMap
=
this
.
crAsMap
[
"metadata"
]
!!
as
Map
<
String
,
String
>
return
metadataAsMap
[
"name"
]
!!
}
}
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