mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 22:14:59 +00:00
Fix EC2 Discovery settings (#17651)
Fixes two bugs introduced by the settings refactoring in #16602
This commit is contained in:
parent
9fc4ce294a
commit
b08d453a0a
@ -76,8 +76,8 @@ public class AwsEc2ServiceImpl extends AbstractLifecycleComponent<AwsEc2Service>
|
|||||||
String key = CLOUD_EC2.KEY_SETTING.get(settings);
|
String key = CLOUD_EC2.KEY_SETTING.get(settings);
|
||||||
String secret = CLOUD_EC2.SECRET_SETTING.get(settings);
|
String secret = CLOUD_EC2.SECRET_SETTING.get(settings);
|
||||||
|
|
||||||
String proxyHost = CLOUD_EC2.PROXY_HOST_SETTING.get(settings);
|
if (CLOUD_EC2.PROXY_HOST_SETTING.exists(settings)) {
|
||||||
if (proxyHost != null) {
|
String proxyHost = CLOUD_EC2.PROXY_HOST_SETTING.get(settings);
|
||||||
Integer proxyPort = CLOUD_EC2.PROXY_PORT_SETTING.get(settings);
|
Integer proxyPort = CLOUD_EC2.PROXY_PORT_SETTING.get(settings);
|
||||||
String proxyUsername = CLOUD_EC2.PROXY_USERNAME_SETTING.get(settings);
|
String proxyUsername = CLOUD_EC2.PROXY_USERNAME_SETTING.get(settings);
|
||||||
String proxyPassword = CLOUD_EC2.PROXY_PASSWORD_SETTING.get(settings);
|
String proxyPassword = CLOUD_EC2.PROXY_PASSWORD_SETTING.get(settings);
|
||||||
@ -130,12 +130,13 @@ public class AwsEc2ServiceImpl extends AbstractLifecycleComponent<AwsEc2Service>
|
|||||||
|
|
||||||
this.client = new AmazonEC2Client(credentials, clientConfiguration);
|
this.client = new AmazonEC2Client(credentials, clientConfiguration);
|
||||||
|
|
||||||
String endpoint = CLOUD_EC2.ENDPOINT_SETTING.get(settings);
|
if (CLOUD_EC2.ENDPOINT_SETTING.exists(settings)) {
|
||||||
if (endpoint != null) {
|
final String endpoint = CLOUD_EC2.ENDPOINT_SETTING.get(settings);
|
||||||
logger.debug("using explicit ec2 endpoint [{}]", endpoint);
|
logger.debug("using explicit ec2 endpoint [{}]", endpoint);
|
||||||
client.setEndpoint(endpoint);
|
client.setEndpoint(endpoint);
|
||||||
} else if (CLOUD_EC2.REGION_SETTING.exists(settings)) {
|
} else if (CLOUD_EC2.REGION_SETTING.exists(settings)) {
|
||||||
String region = CLOUD_EC2.REGION_SETTING.get(settings);
|
final String region = CLOUD_EC2.REGION_SETTING.get(settings);
|
||||||
|
final String endpoint;
|
||||||
if (region.equals("us-east-1") || region.equals("us-east")) {
|
if (region.equals("us-east-1") || region.equals("us-east")) {
|
||||||
endpoint = "ec2.us-east-1.amazonaws.com";
|
endpoint = "ec2.us-east-1.amazonaws.com";
|
||||||
} else if (region.equals("us-west") || region.equals("us-west-1")) {
|
} else if (region.equals("us-west") || region.equals("us-west-1")) {
|
||||||
|
@ -44,10 +44,7 @@ public abstract class AbstractAwsTestCase extends ESIntegTestCase {
|
|||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
Settings.Builder settings = Settings.builder()
|
Settings.Builder settings = Settings.builder()
|
||||||
.put(super.nodeSettings(nodeOrdinal))
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
|
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir());
|
||||||
.put("cloud.aws.test.random", randomInt())
|
|
||||||
.put("cloud.aws.test.write_failures", 0.1)
|
|
||||||
.put("cloud.aws.test.read_failures", 0.1);
|
|
||||||
|
|
||||||
// if explicit, just load it and don't load from env
|
// if explicit, just load it and don't load from env
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user