Skip to content

Commit 18b558e

Browse files
authored
feat: Warn when a non-default region is configured (#700)
* feat: Warn when a non-default region is configured * changelog * change warning * typo * typo part 2 * make regenerate-nix * clippy
1 parent 1cb19e4 commit 18b558e

File tree

8 files changed

+31
-17
lines changed

8 files changed

+31
-17
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ All notable changes to this project will be documented in this file.
1414
- BREAKING: Adjust default memory limits of coordinator from `512Mi` to `768Mi` and middlemanager from `1Gi` to `1500Mi` ([#685]).
1515
- Support configuring JVM arguments ([#693]).
1616
- Add `region.name` field in S3Connection.
17-
This field is **ignored** by this operator, see [ingestion] and [deep storage] documentation ([#695]).
17+
This field is **ignored** by this operator, see [ingestion] and [deep storage] documentation.
18+
A warning is emitted when a non-default endpoint is used ([#695], [#700]).
1819

1920
### Changed
2021

@@ -28,6 +29,7 @@ All notable changes to this project will be documented in this file.
2829
[#693]: https://github.com/stackabletech/druid-operator/pull/693
2930
[#685]: https://github.com/stackabletech/druid-operator/pull/685
3031
[#695]: https://github.com/stackabletech/druid-operator/pull/695
32+
[#700]: https://github.com/stackabletech/druid-operator/pull/700
3133

3234
[ingestion]: https://docs.stackable.tech/home/nightly/druid/usage-guide/ingestion/
3335
[deep storage]: https://docs.stackable.tech/home/nightly/druid/usage-guide/deep-storage/

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/druid-operator"
1111

1212
[workspace.dependencies]
1313
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.6.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.87.2" }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.87.3" }
1515
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
1616

1717
anyhow = "1.0"

crate-hashes.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/modules/druid/partials/s3-note.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can specify just a connection/bucket for either ingestion or deep storage or for both, but Druid only supports a single S3 connection under the hood.
44
If two connections are specified, they must be the same. This is easiest if a dedicated S3 Connection Resource is used - not defined inline but as a dedicated object.
55
6-
The connection/bucket `region.name` field is ignored because Druid uses the AWS SDK v1, which ignores the region if the endpoint is set.
6+
The `S3Connection` `region` field is ignored because Druid uses the AWS SDK v1, which ignores the region if the endpoint is set.
77
The host is a required field, therefore the endpoint will always be set.
88
99
TLS for S3 is not yet supported.

rust/operator-binary/src/crd/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ impl v1alpha1::DruidCluster {
389389
Ok(result)
390390
}
391391

392+
#[allow(clippy::type_complexity)]
392393
pub fn build_role_properties(
393394
&self,
394395
) -> HashMap<

rust/operator-binary/src/druid_controller.rs

+11
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,17 @@ fn build_rolegroup_config_map(
734734
};
735735

736736
if let Some(s3) = s3_conn {
737+
if !s3.region.is_default_config() {
738+
// Raising this as warning instead of returning an error, better safe than sorry.
739+
// It might still work out for the user.
740+
tracing::warn!(
741+
region = ?s3.region,
742+
"You configured a non-default region on the S3Connection.
743+
The S3Connection region field is ignored because Druid uses the AWS SDK v1, which ignores the region if the endpoint is set. \
744+
The host is a required field, therefore the endpoint will always be set."
745+
)
746+
}
747+
737748
conf.insert(
738749
S3_ENDPOINT_URL.to_string(),
739750
Some(s3.endpoint().context(ConfigureS3Snafu)?.to_string()),

0 commit comments

Comments
 (0)