mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-29 06:04:06 +00:00
ci: reserve the storage and WAL keys of extra_env regardless of case
GreptimeDB reads its environment keys without regard to case, so a lowercase wal or storage segment must be rejected as well. Signed-off-by: jeremyhi <fengjiachun@gmail.com>
This commit is contained in:
@@ -109,7 +109,8 @@ def parse_extra_env(text: str) -> dict:
|
||||
raise ValueError(f"extra_env line is not a new K=V: {line!r}")
|
||||
env[name.strip()] = value.strip()
|
||||
for name, value in env.items():
|
||||
if not ENV_NAME.fullmatch(name) or name.startswith(RESERVED_ENV) or "\n" in value:
|
||||
# GreptimeDB matches its environment keys without regard to case.
|
||||
if not ENV_NAME.fullmatch(name) or name.upper().startswith(RESERVED_ENV) or "\n" in value:
|
||||
raise ValueError(f"extra_env may not set {name!r}")
|
||||
if name in DEPTHS:
|
||||
positive(name, value, 4096)
|
||||
|
||||
@@ -114,6 +114,8 @@ class PlanTest(unittest.TestCase):
|
||||
{"extra_env": "GREPTIMEDB_STANDALONE__STORAGE__BUCKET=other"}, {"extra_env": "NO_VALUE"},
|
||||
{"extra_env": "GREPTIMEDB_STANDALONE__WAL__FLUSH_INTERVAL=100ms", "restart": True},
|
||||
{"extra_env": "GREPTIMEDB_STANDALONE__WAL__SYNC_WRITE=false"},
|
||||
{"extra_env": "GREPTIMEDB_STANDALONE__wal__FLUSH_INTERVAL=100ms", "restart": True},
|
||||
{"extra_env": "greptimedb_standalone__Storage__bucket=other"},
|
||||
{"extra_env": "GREPTIMEDB_OSWAL_MAX_SEALED_BATCHES=4", "sweep": "MAX_IN_FLIGHT_CREATES=2,3"},
|
||||
{"extra_env": "A=1\nA=2"}, {"extra_env": '{"A": true}'}, {"extra_env": "1A=x"},
|
||||
{"extra_env": "GREPTIMEDB_OSWAL_MAX_IN_FLIGHT_CREATES=many"}, {"configs": "R,X"},
|
||||
|
||||
Reference in New Issue
Block a user