Skip to content

Commit ad86434

Browse files
committed
feat: make sure to auto update kleinkram config
1 parent e67a82c commit ad86434

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

cli/kleinkram/config.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,18 @@ def _load_config_if_compatible(path: Path) -> Optional[Config]:
184184
return None
185185
with open(path, "r") as f:
186186
try:
187-
return _config_from_dict(json.load(f))
187+
dct = json.load(f)
188+
189+
migrated = False
190+
for key, value in dct.get("endpoints", {}).items():
191+
if "s3" in value and "minio.datasets." in value["s3"]:
192+
value["s3"] = value["s3"].replace("minio.datasets.", "s3.datasets.")
193+
migrated = True
194+
195+
config = _config_from_dict(dct)
196+
if migrated:
197+
save_config(config, path)
198+
return config
188199
except Exception:
189200
return None
190201

0 commit comments

Comments
 (0)