- Notifications
You must be signed in to change notification settings - Fork235
-
Hi, In my operator reconciliation loop, I need to manage There are straightforward ways to do this in Helm Chart using Go templates and in Ansible Operator SDK using Jinja templates. Is there a recommended/preferred way of doing this in the Java Operator SDK? I was thinking of loading some template resource as a stream within the reconciler and then using something likeQute orThymeleaf to produce the final result but I don't know how tied to the HTTP/REST world they are.... Any recommendations or suggestions? Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments 4 replies
-
You could create a YAML file with that content, load it in your operator and then create a builder from it and just edit the values that need replacing. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Yes that's what I'm doing for regular Kubernetes resources. However it's not convenient to dynamically change properties, json or XML files that are for example wrapped into a |
BetaWas this translation helpful?Give feedback.
All reactions
-
How would you like it to look like? Maybe that's something that's general-purpose enough that we could implement it at the JOSDK level? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hi there, I did a first implementation usingQute templating from Quarkus and it's very convenient to use. From my Java code (in a dependent resource), I just use the In this use-case, the I think this could be super-useful to have this at the JOSDK level, may be in the
|
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I will take a look, I have been thinking about this issue on and off for a while actually but I've never really devoted my full attention to it yet. The idea that's been running in my head would be to try to create (at least for the Quarkus side of things) "compiled" templates at build time which would make it efficient to perform these kinds of operations (but also resource cloning) at runtime. It hasn't been a priority so far and I'm actually unsure if there's anything more to it than just a crazy idea 😅 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hmm, good question, I usually use mustache if need some simple tamplating: |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1