imbajin commented on issue #2942: URL: https://github.com/apache/incubator-hugegraph/issues/2942#issuecomment-3782904198
> One corner case to watch out for: not all URL options should default to http://. > > For example server.k8s_url currently defaults to [127.0.0.1:8888](https://127.0.0.1:8888) and in real deployments K8S API often requires HTTPS + CA config. If we implement a generic “prepend http:// when scheme is missing” for all URL-like keys (anything containing url / urls), then a user config like: > > server.k8s_url=127.0.0.1:8888 > > would silently become http://127.0.0.1:8888, effectively downgrading the scheme and potentially breaking K8S integration. > > [incubator-hugegraph/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java](https://github.com/apache/incubator-hugegraph/blob/37be6cdde3a2ffb71091453b366f28ae446db882/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java#L275-L282) > > Lines 275 to 282 in [37be6cd](/apache/incubator-hugegraph/commit/37be6cdde3a2ffb71091453b366f28ae446db882) > > public static final ConfigOption<String> SERVER_K8S_URL = > new ConfigOption<>( > "server.k8s_url", > "The url of k8s.", > disallowEmpty(), > "https://127.0.0.1:8888" > ); @bitflicker64 Good catch, thank you for your reminder and careful consideration. Your perspective is very reasonable, and our intention is not to enforce a uniform prefix for all configurations. The core point is that for configurations that do not affect the outcome and are suitable for using the default `http://` prefix, we should maintain consistency and ease of use. For specific configurations that are not suitable for using `http://` (such as `server.k8s_url`), we should allow separate configuration to override the default value. We will provide unified encapsulation at the code level while allowing flexible selection at the configuration level based on actual circumstances. Thank you again for your valuable feedback! -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
