ryerraguntla commented on code in PR #4043:
URL: https://github.com/apache/iggy/pull/4043#discussion_r3977763618
##########
gateways/kafka/src/main.rs:
##########
@@ -71,13 +76,20 @@ const KNOWN_KAFKA_ENV_VARS: &[&str] = &[
"IGGY_KAFKA_SHUTDOWN_DRAIN_TIMEOUT_SECS",
];
-/// Rejects any `IGGY_KAFKA_*` env var not in [`KNOWN_KAFKA_ENV_VARS`] - a
typo (e.g.
-/// `IGGY_KAFKA_BIN_ADDR`) would otherwise be silently ignored:
`core/configs`' central provider
-/// skips the whole `IGGY_KAFKA_` prefix, and this crate's own `env_var()`
only ever looks up
-/// exact known names, so nothing reads the misspelled var and nothing warns
either.
+/// Rejects any `IGGY_KAFKA_*` env var not in [`KNOWN_KAFKA_ENV_VARS`] or
+/// [`IggyBridgeConfig::KNOWN_ENV_VARS`] - a typo (e.g. `IGGY_KAFKA_BIN_ADDR`)
would otherwise be
+/// silently ignored: `core/configs`' central provider skips the whole
`IGGY_KAFKA_` prefix, and
+/// this crate's own `env_var()` only ever looks up exact known names, so
nothing reads the
+/// misspelled var and nothing warns either. Checking both lists (not
`IggyBridgeConfig`'s
+/// wiring into `main`) is deliberate: a user who exports a bridge var ahead of
+/// `#3535`/`#3536` landing must not see a spurious "unknown env var"
rejection for a name this
+/// crate already recognizes.
fn reject_unknown_kafka_env_vars() -> Result<(), String> {
for (key, _) in std::env::vars() {
- if key.starts_with("IGGY_KAFKA_") &&
!KNOWN_KAFKA_ENV_VARS.contains(&key.as_str()) {
+ if key.starts_with("IGGY_KAFKA_")
+ && !KNOWN_KAFKA_ENV_VARS.contains(&key.as_str())
+ && !IggyBridgeConfig::KNOWN_ENV_VARS.contains(&key.as_str())
Review Comment:
fixed,
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]