From 042a0c86f876250734ce61e92b731947f970710f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sun, 27 Apr 2025 12:14:46 +0200 Subject: [PATCH 1/2] docs: base64 decode and encode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- docs/reference.md | 9 +++++++++ src/test/resources/glue/CopySecretToConfigMap.yaml | 1 + 2 files changed, 10 insertions(+) diff --git a/docs/reference.md b/docs/reference.md index 49bec73..b9f20dd 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -250,6 +250,15 @@ or for Deployment: `glue.operator.resource-label-selector.apps/v1#Deployment=mylabel=samplevalue` +## Extending qute templating engine + +[Qute templating engine](https://quarkus.io/guides/qute) is very flexible. +We extend it only we two additional functions, to decode and encode base64 values. More might come in the future. +You can call these on every string of byte array: + + + + ## Implementation details and performance Informers are used optimally, in terms of that, for every resource type only one informer is registered in the background. Event there are more `Glue` or `GlueOperator` diff --git a/src/test/resources/glue/CopySecretToConfigMap.yaml b/src/test/resources/glue/CopySecretToConfigMap.yaml index acb98a1..24b5417 100644 --- a/src/test/resources/glue/CopySecretToConfigMap.yaml +++ b/src/test/resources/glue/CopySecretToConfigMap.yaml @@ -1,3 +1,4 @@ +# Sample copies content of a secret from namespace-b to a config map in namespace-b. apiVersion: io.javaoperatorsdk.operator.glue/v1beta1 kind: Glue metadata: From 49c6df92a1fde7815a5693b8c852f07bc4fd341c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sun, 27 Apr 2025 12:17:05 +0200 Subject: [PATCH 2/2] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- docs/reference.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/reference.md b/docs/reference.md index b9f20dd..048793e 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -254,10 +254,23 @@ or for Deployment: [Qute templating engine](https://quarkus.io/guides/qute) is very flexible. We extend it only we two additional functions, to decode and encode base64 values. More might come in the future. -You can call these on every string of byte array: +You can call these on every string of byte array, using `decodeBase64` and `encodeBase64` keywords. +```yaml + resourceTemplate: | + apiVersion: v1 + kind: ConfigMap + metadata: + name: my-secret-copy + namespace: namespace-a + data: + {#for entry in secret-to-copy.data} + {entry.key}: {entry.value.decodeBase64} + {/for} +``` +See the full example [here](https://github.com/java-operator-sdk/kubernetes-glue-operator/blob/main/src/test/resources/glue/CopySecretToConfigMap.yaml). ## Implementation details and performance