Remove checks for legacy .yaml and .json config files. (#792)
Signed-off-by: Marc Handalian <handalm@amazon.com>
This commit is contained in:
parent
b3c8f71e2d
commit
da78b889c8
|
@ -81,14 +81,6 @@ public class InternalSettingsPreparer {
|
||||||
initializeSettings(output, input, properties);
|
initializeSettings(output, input, properties);
|
||||||
Environment environment = new Environment(output.build(), configPath);
|
Environment environment = new Environment(output.build(), configPath);
|
||||||
|
|
||||||
if (Files.exists(environment.configFile().resolve("opensearch.yaml"))) {
|
|
||||||
throw new SettingsException("opensearch.yaml was deprecated in 5.5.0 and must be renamed to opensearch.yml");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Files.exists(environment.configFile().resolve("opensearch.json"))) {
|
|
||||||
throw new SettingsException("opensearch.json was deprecated in 5.5.0 and must be converted to opensearch.yml");
|
|
||||||
}
|
|
||||||
|
|
||||||
output = Settings.builder(); // start with a fresh output
|
output = Settings.builder(); // start with a fresh output
|
||||||
Path path = environment.configFile().resolve("opensearch.yml");
|
Path path = environment.configFile().resolve("opensearch.yml");
|
||||||
if (Files.exists(path)) {
|
if (Files.exists(path)) {
|
||||||
|
|
|
@ -114,28 +114,6 @@ public class InternalSettingsPreparerTests extends OpenSearchTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/358")
|
|
||||||
public void testYamlNotAllowed() throws IOException {
|
|
||||||
InputStream yaml = getClass().getResourceAsStream("/config/opensearch.yml");
|
|
||||||
Path config = homeDir.resolve("config");
|
|
||||||
Files.createDirectory(config);
|
|
||||||
Files.copy(yaml, config.resolve("opensearch.yaml"));
|
|
||||||
SettingsException e = expectThrows(SettingsException.class, () -> InternalSettingsPreparer.prepareEnvironment(
|
|
||||||
Settings.builder().put(baseEnvSettings).build(), emptyMap(), null, DEFAULT_NODE_NAME_SHOULDNT_BE_CALLED));
|
|
||||||
assertEquals("opensearch.yaml was deprecated in 5.5.0 and must be renamed to opensearch.yml", e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/358")
|
|
||||||
public void testJsonNotAllowed() throws IOException {
|
|
||||||
InputStream yaml = getClass().getResourceAsStream("/config/opensearch.json");
|
|
||||||
Path config = homeDir.resolve("config");
|
|
||||||
Files.createDirectory(config);
|
|
||||||
Files.copy(yaml, config.resolve("opensearch.json"));
|
|
||||||
SettingsException e = expectThrows(SettingsException.class, () -> InternalSettingsPreparer.prepareEnvironment(
|
|
||||||
Settings.builder().put(baseEnvSettings).build(), emptyMap(), null, DEFAULT_NODE_NAME_SHOULDNT_BE_CALLED));
|
|
||||||
assertEquals("opensearch.json was deprecated in 5.5.0 and must be converted to opensearch.yml", e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSecureSettings() {
|
public void testSecureSettings() {
|
||||||
MockSecureSettings secureSettings = new MockSecureSettings();
|
MockSecureSettings secureSettings = new MockSecureSettings();
|
||||||
secureSettings.setString("foo", "secret");
|
secureSettings.setString("foo", "secret");
|
||||||
|
|
Loading…
Reference in New Issue