Skip to content

Commit 8ba1a5c

Browse files
authored
Expose proxy settings for GCS repositories (#85785) (#85833)
They were added in #82737, but not exposed via the GCSPlugin to end users.
1 parent 2440f0a commit 8ba1a5c

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

docs/changelog/85785.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 85785
2+
summary: Expose proxy settings for GCS repositories
3+
area: Snapshot/Restore
4+
type: bug
5+
issues:
6+
- 84569

modules/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStoragePlugin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ public List<Setting<?>> getSettings() {
7171
GoogleCloudStorageClientSettings.CONNECT_TIMEOUT_SETTING,
7272
GoogleCloudStorageClientSettings.READ_TIMEOUT_SETTING,
7373
GoogleCloudStorageClientSettings.APPLICATION_NAME_SETTING,
74-
GoogleCloudStorageClientSettings.TOKEN_URI_SETTING
74+
GoogleCloudStorageClientSettings.TOKEN_URI_SETTING,
75+
GoogleCloudStorageClientSettings.PROXY_TYPE_SETTING,
76+
GoogleCloudStorageClientSettings.PROXY_HOST_SETTING,
77+
GoogleCloudStorageClientSettings.PROXY_PORT_SETTING
7578
);
7679
}
7780

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
package org.elasticsearch.repositories.gcs;
10+
11+
import org.elasticsearch.common.settings.Setting;
12+
import org.elasticsearch.common.settings.Settings;
13+
import org.elasticsearch.test.ESTestCase;
14+
import org.junit.Assert;
15+
16+
import java.util.List;
17+
18+
public class GoogleCloudStoragePluginTests extends ESTestCase {
19+
20+
public void testExposedSettings() {
21+
List<Setting<?>> settings = new GoogleCloudStoragePlugin(Settings.EMPTY).getSettings();
22+
23+
Assert.assertEquals(
24+
List.of(
25+
"gcs.client.*.credentials_file",
26+
"gcs.client.*.endpoint",
27+
"gcs.client.*.project_id",
28+
"gcs.client.*.connect_timeout",
29+
"gcs.client.*.read_timeout",
30+
"gcs.client.*.application_name",
31+
"gcs.client.*.token_uri",
32+
"gcs.client.*.proxy.type",
33+
"gcs.client.*.proxy.host",
34+
"gcs.client.*.proxy.port"
35+
),
36+
settings.stream().map(Setting::getKey).toList()
37+
);
38+
}
39+
}

0 commit comments

Comments
 (0)