Closed gAmUssA closed 4 years ago
fabric8 model object have Jackson annotation so if you'll just serialize them to JSON then you should be good to go. See example sub-project for reference https://github.com/fkorotkov/k8s-kotlin-dsl/blob/master/example/src/test/kotlin/BaseDeploymentTest.kt#L15
Just to take the example a bit farther, the steps to Json then to yaml aren't strictly necessary, you can achieve the same via
fun Deployment.asYaml(): String {
return YAMLMapper().writeValueAsString(this)
}
@rgbrizzlehizzle thank you!
Hello
Say, I have a resource( deployment or stateful set). and I was wondering if there is a method that returns json or yaml representation?
Thank you