used EnvUtils for system properties in core#4629
Conversation
| String solrHome = cli.getOptionValue(SOLR_HOME_OPTION); | ||
| if (StrUtils.isNullOrEmpty(solrHome)) { | ||
| solrHome = System.getProperty("solr.home"); | ||
| solrHome = EnvUtils.getProperty("solr.home", EnvUtils.getProperty("solr.solr.home")); |
There was a problem hiding this comment.
The solr.solr.home thing was always a bit werid... But is a "thing". What prompted this change here?
There was a problem hiding this comment.
my bad, I've fixed ZkCpTool to use EnvUtils.getProperty("solr.home") to preserve the original behaviour. Thanks!
e2d9407 to
8df1569
Compare
| final String prop = "solr.solr.home"; | ||
| source = "system property: " + prop; | ||
| home = System.getProperty(prop); | ||
| home = EnvUtils.getProperty(prop); |
There was a problem hiding this comment.
bit nervous on this, but dug in more and looks okay!
|
@iprithv can you add a changelog entry? This is a new feature to Solr, that you can set proeprties via environment variables! |
|
sure, added changelog. thanks! |
ab7bfd6 to
009a724
Compare
it burped ;-). Can you tweak the type! |
Can use either system properties or environment variables. Co-authored-by: Eric Pugh <epugh@opensourceconnections.com> (cherry picked from commit c0baa49)
|
Eric, you merged this but it wasn't passing spotless checks. Mikhail cleaned up after you in 86bd520 |
| @@ -0,0 +1,7 @@ | |||
| title: Core system properties can now also be configured via environment variables | |||
| type: changed | |||
There was a problem hiding this comment.
I think "added" reflects what happened, as the PR is an opt-in change for a user -- users need to do something to take advantage of this. "changed" is a change to existing users on an upgrade without them lifting a finger.
replaced direct
System.getProperty(...)/System.getenvcalls for Solr configuration properties withEnvUtilsequivalents throughout the core module. this provides consistent support forSOLR_*environment variables (and the automaticSOLR_FOO_BAR→solr.foo.barconversion) in all core startup and configuration paths.