[bitnami/keycloak] fix: preserve timestamps in init script (#33812)

* [bitnami/keycloak] fix: preserve timestamps in init script

With the latest Keycloak version, the timestamps of providers is compared to the timestamp of the latest provider build.

When starting keycloak with the `--optimized` flag, keycloak will throw an error when the timestamp of the providers is more recent than it was during the build.

> A provider JAR was updated since the last build, please rebuild for this to be fully utilized.

As we do not preserve the timestamp in the init script, this error is always thrown when starting keycloak as optimized.

This is fixed by preserving the timestamp in the initContainer `cp` commands.

see: https://github.com/keycloak/keycloak/issues/38893

Signed-off-by: msvechla <m.svechla@gmail.com>
Signed-off-by: Marius Svechla <m.svechla@gmail.com>

* Update CHANGELOG.md

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>

* Update CHANGELOG.md

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>

---------

Signed-off-by: msvechla <m.svechla@gmail.com>
Signed-off-by: Marius Svechla <m.svechla@gmail.com>
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
Co-authored-by: Bitnami Bot <bitnami.bot@broadcom.com>
This commit is contained in:
msvechla
2025-05-22 09:17:22 +02:00
committed by GitHub
parent 075989dd65
commit f3ec521adf
3 changed files with 10 additions and 6 deletions

View File

@@ -1,8 +1,12 @@
# Changelog
## 24.7.1 (2025-05-22)
* [bitnami/keycloak] fix: preserve timestamps in init script ([#33812](https://github.com/bitnami/charts/pull/33812))
## 24.7.0 (2025-05-19)
* [bitnami/keycloak] Improvements to Keycloak cache handling ([#32885](https://github.com/bitnami/charts/pull/32885))
* [bitnami/keycloak] Improvements to Keycloak cache handling (#32885) ([b2500eb](https://github.com/bitnami/charts/commit/b2500ebf9a4b983f8975d0d426a9c1473453fe1f)), closes [#32885](https://github.com/bitnami/charts/issues/32885)
## <small>24.6.7 (2025-05-13)</small>

View File

@@ -36,4 +36,4 @@ maintainers:
name: keycloak
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/keycloak
version: 24.7.0
version: 24.7.1

View File

@@ -104,10 +104,10 @@ spec:
info "Copying writable dirs to empty dir"
# In order to not break the application functionality we need to make some
# directories writable, so we need to copy it to an empty dir volume
cp -r --preserve=mode /opt/bitnami/keycloak/lib/quarkus /emptydir/app-quarkus-dir
cp -r --preserve=mode /opt/bitnami/keycloak/data /emptydir/app-data-dir
cp -r --preserve=mode /opt/bitnami/keycloak/providers /emptydir/app-providers-dir
cp -r --preserve=mode /opt/bitnami/keycloak/themes /emptydir/app-themes-dir
cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/lib/quarkus /emptydir/app-quarkus-dir
cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/data /emptydir/app-data-dir
cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/providers /emptydir/app-providers-dir
cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/themes /emptydir/app-themes-dir
info "Copy operation completed"
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) | nindent 12 }}