mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-21 12:27:37 +00:00
Update settings filter
Update settings filter to match elasticsearch/elasticsearch#9748
This commit is contained in:
parent
3a4e472752
commit
20a99919bf
@ -48,7 +48,10 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
|
|||||||
@Inject
|
@Inject
|
||||||
public AwsEc2Service(Settings settings, SettingsFilter settingsFilter, NetworkService networkService, DiscoveryNodeService discoveryNodeService) {
|
public AwsEc2Service(Settings settings, SettingsFilter settingsFilter, NetworkService networkService, DiscoveryNodeService discoveryNodeService) {
|
||||||
super(settings);
|
super(settings);
|
||||||
settingsFilter.addFilter(new AwsSettingsFilter());
|
settingsFilter.addFilter("cloud.key");
|
||||||
|
settingsFilter.addFilter("cloud.account");
|
||||||
|
settingsFilter.addFilter("cloud.aws.access_key");
|
||||||
|
settingsFilter.addFilter("cloud.aws.secret_key");
|
||||||
// add specific ec2 name resolver
|
// add specific ec2 name resolver
|
||||||
networkService.addCustomNameResolver(new Ec2NameResolver(settings));
|
networkService.addCustomNameResolver(new Ec2NameResolver(settings));
|
||||||
discoveryNodeService.addCustomAttributeProvider(new Ec2CustomNodeAttributes(settings));
|
discoveryNodeService.addCustomAttributeProvider(new Ec2CustomNodeAttributes(settings));
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.cloud.aws;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.settings.ImmutableSettings;
|
|
||||||
import org.elasticsearch.common.settings.SettingsFilter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class AwsSettingsFilter implements SettingsFilter.Filter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void filter(ImmutableSettings.Builder settings) {
|
|
||||||
settings.remove("cloud.key");
|
|
||||||
settings.remove("cloud.account");
|
|
||||||
settings.remove("cloud.aws.access_key");
|
|
||||||
settings.remove("cloud.aws.secret_key");
|
|
||||||
}
|
|
||||||
}
|
|
@ -48,10 +48,8 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
|
|||||||
private Map<Tuple<String, String>, AmazonS3Client> clients = new HashMap<Tuple<String,String>, AmazonS3Client>();
|
private Map<Tuple<String, String>, AmazonS3Client> clients = new HashMap<Tuple<String,String>, AmazonS3Client>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public InternalAwsS3Service(Settings settings, SettingsFilter settingsFilter) {
|
public InternalAwsS3Service(Settings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
|
|
||||||
settingsFilter.addFilter(new AwsSettingsFilter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,8 +34,8 @@ public class TestAwsS3Service extends InternalAwsS3Service {
|
|||||||
IdentityHashMap<AmazonS3, TestAmazonS3> clients = new IdentityHashMap<AmazonS3, TestAmazonS3>();
|
IdentityHashMap<AmazonS3, TestAmazonS3> clients = new IdentityHashMap<AmazonS3, TestAmazonS3>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TestAwsS3Service(Settings settings, SettingsFilter settingsFilter) {
|
public TestAwsS3Service(Settings settings) {
|
||||||
super(settings, settingsFilter);
|
super(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user