Skip to content

Commit 118f81b

Browse files
authored
docs: base64 decode and encode (#182)
Signed-off-by: Attila Mészáros <[email protected]>
1 parent d36e223 commit 118f81b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/reference.md

+22
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,28 @@ or for Deployment:
250250
`glue.operator.resource-label-selector.apps/v1#Deployment=mylabel=samplevalue`
251251

252252

253+
## Extending qute templating engine
254+
255+
[Qute templating engine](https://quarkus.io/guides/qute) is very flexible.
256+
We extend it only we two additional functions, to decode and encode base64 values. More might come in the future.
257+
You can call these on every string of byte array, using `decodeBase64` and `encodeBase64` keywords.
258+
259+
```yaml
260+
resourceTemplate: |
261+
apiVersion: v1
262+
kind: ConfigMap
263+
metadata:
264+
name: my-secret-copy
265+
namespace: namespace-a
266+
data:
267+
{#for entry in secret-to-copy.data}
268+
{entry.key}: {entry.value.decodeBase64}
269+
{/for}
270+
271+
```
272+
273+
See the full example [here](https://github.com/java-operator-sdk/kubernetes-glue-operator/blob/main/src/test/resources/glue/CopySecretToConfigMap.yaml).
274+
253275
## Implementation details and performance
254276

255277
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`

src/test/resources/glue/CopySecretToConfigMap.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Sample copies content of a secret from namespace-b to a config map in namespace-b.
12
apiVersion: io.javaoperatorsdk.operator.glue/v1beta1
23
kind: Glue
34
metadata:

0 commit comments

Comments
 (0)