Signed-off-by: wind57 <eugen.rabii@gmail.com>
This commit is contained in:
wind57
2025-03-27 14:09:38 +02:00
parent e67cc1ac3b
commit b851f9c127
3 changed files with 5 additions and 4 deletions

View File

@@ -3,7 +3,9 @@ spring:
kubernetes:
secrets:
paths:
- /tmp/application.properties
# at the moment, we do not support reading properties/yaml/yml
# files when mounting via 'paths'
- /tmp/from.properties.secret.key
enabled: true
config:

View File

@@ -103,7 +103,7 @@ class K8sClientSecretMountBootstrapPollingIT extends K8sClientReloadBase {
V1Secret secret = (V1Secret) util.yaml("mount/secret.yaml");
secret.setData(Map.of(Constants.APPLICATION_PROPERTIES, Base64.getEncoder()
.encode("from.properties.secret.key=as-mount-changed".getBytes(StandardCharsets.UTF_8))));
coreV1Api.readNamespacedSecret("secret-reload", NAMESPACE, null);
coreV1Api.replaceNamespacedSecret("secret-reload", NAMESPACE, secret, null, null, null, null);
Commons.waitForLogStatement("Detected change in config maps/secrets, reload will be triggered", K3S,
IMAGE_NAME);

View File

@@ -5,5 +5,4 @@ metadata:
namespace: default
data:
# from.properties.secret.key=initial
application.properties: |
ZnJvbS5wcm9wZXJ0aWVzLnNlY3JldC5rZXk9aW5pdGlhbA==
from.properties.secret.key: aW5pdGlhbA==