This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 14e15b4ab4 [MINOR] fix: prevent overwriting existing config keys 
during initialization (#7318)
14e15b4ab4 is described below

commit 14e15b4ab4068d690d04ee316d2c8600bbe3db0a
Author: Bryan Maloyer <[email protected]>
AuthorDate: Sun Jun 8 18:18:22 2025 +0200

    [MINOR] fix: prevent overwriting existing config keys during initialization 
(#7318)
    
    ### What changes were proposed in this pull request?
    
    The script now only sets config values from init_config if the key does
    not already exist in config_map, instead of always overwriting existing
    values.
    
    ### Why are the changes needed?
    
    This allows users to override config values in iceberg-rest-server,
    which was previously not possible because the script always overwrote
    user-supplied settings.
---
 dev/docker/iceberg-rest-server/rewrite_config.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dev/docker/iceberg-rest-server/rewrite_config.py 
b/dev/docker/iceberg-rest-server/rewrite_config.py
index ac24ad9c08..3f1be57c7c 100755
--- a/dev/docker/iceberg-rest-server/rewrite_config.py
+++ b/dev/docker/iceberg-rest-server/rewrite_config.py
@@ -83,8 +83,11 @@ def update_config(config, key, value):
 config_file_path = "conf/gravitino-iceberg-rest-server.conf"
 config_map = parse_config_file(config_file_path)
 
+# Set from init_config only if the key doesn't exist
 for k, v in init_config.items():
-    update_config(config_map, k, v)
+    full_key = config_prefix + k
+    if full_key not in config_map:
+        update_config(config_map, k, v)
 
 for k, v in env_map.items():
     if k in os.environ:

Reply via email to