Skip to content

docs: base64 decode and encode #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,28 @@ 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, 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

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`
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/glue/CopySecretToConfigMap.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down