Skip to content

Commit 1edd66b

Browse files
committed
chore: Merge branch 'main' into chore/opentelemetry-bumps
2 parents 230118b + bc176bf commit 1edd66b

File tree

21 files changed

+78
-97
lines changed

21 files changed

+78
-97
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-certs/src/ca/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ where
380380
key_certificate: &str,
381381
key_private_key: &str,
382382
) -> Result<Self, SecretError<S::Error>> {
383-
if !secret.type_.as_ref().is_some_and(|s| s == TLS_SECRET_TYPE) {
383+
if secret.type_.as_ref().is_none_or(|s| s != TLS_SECRET_TYPE) {
384384
return InvalidSecretTypeSnafu.fail();
385385
}
386386

crates/stackable-operator/CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ All notable changes to this project will be documented in this file.
2121

2222
[#977]: https://github.com/stackabletech/operator-rs/pull/977
2323

24+
## [0.87.2] - 2025-03-10
25+
26+
### Changed
27+
28+
- Make `region.name` field in in S3ConnectionSpec public ([#980]).
29+
30+
[#980]: https://github.com/stackabletech/operator-rs/pull/980
31+
32+
## [0.87.1] - 2025-03-10
33+
34+
### Changed
35+
36+
- Refactor `region` field in S3ConnectionSpec ([#976]).
37+
38+
[#976]: https://github.com/stackabletech/operator-rs/pull/976
39+
2440
## [0.87.0] - 2025-02-28
2541

2642
### Changed
@@ -41,7 +57,7 @@ All notable changes to this project will be documented in this file.
4157

4258
### Added
4359

44-
- Add `region` field to S3ConnectionSpec ([#959]).
60+
- BREAKING: Add `region` field to S3ConnectionSpec (defaults to `us-east-1`) ([#959]).
4561

4662
[#959]: https://github.com/stackabletech/operator-rs/pull/959
4763

crates/stackable-operator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "stackable-operator"
33
description = "Stackable Operator Framework"
4-
version = "0.87.0"
4+
version = "0.87.2"
55
authors.workspace = true
66
license.workspace = true
77
edition.workspace = true

crates/stackable-operator/src/commons/rbac.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub enum Error {
3030
/// Build RBAC objects for the product workloads.
3131
/// The `product_name` is meant to be the product name, for example: zookeeper, airflow, etc.
3232
/// and it is a assumed that a ClusterRole named `{product_name}-clusterrole` exists.
33-
3433
pub fn build_rbac_resources<T: Clone + Resource<DynamicType = ()>>(
3534
resource: &T,
3635
// 'product_name' is not used to build the names of the serviceAccount and roleBinding objects,

crates/stackable-operator/src/commons/s3/crd.rs

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,13 @@ pub struct S3ConnectionSpec {
5656
#[serde(default, skip_serializing_if = "Option::is_none")]
5757
pub port: Option<u16>,
5858

59-
/// AWS service API region used by the AWS SDK when using AWS S3 buckets.
59+
/// Bucket region used for signing headers (sigv4).
6060
///
61-
/// This defaults to `us-east-1` and can be ignored if not using AWS S3
62-
/// buckets.
61+
/// This defaults to `us-east-1` which is compatible with other implementations such as Minio.
6362
///
64-
/// NOTE: This is not the bucket region, and is used by the AWS SDK to
65-
/// construct endpoints for various AWS service APIs. It is only useful when
66-
/// using AWS S3 buckets.
67-
///
68-
/// When using AWS S3 buckets, you can configure optimal AWS service API
69-
/// connections in the following ways:
70-
/// - From **inside** AWS: Use an auto-discovery source (eg: AWS IMDS).
71-
/// - From **outside** AWS, or when IMDS is disabled, explicity set the
72-
/// region name nearest to where the client application is running from.
63+
/// WARNING: Some products use the Hadoop S3 implementation which falls back to us-east-2.
7364
#[serde(default)]
74-
pub region: AwsRegion,
65+
pub region: Region,
7566

7667
/// Which access style to use.
7768
/// Defaults to virtual hosted-style as most of the data products out there.
@@ -103,56 +94,22 @@ pub enum S3AccessStyle {
10394
VirtualHosted,
10495
}
10596

106-
/// Set a named AWS region, or defer to an auto-discovery mechanism.
97+
/// Set a named S3 Bucket region.
10798
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
10899
#[serde(rename_all = "camelCase")]
109-
pub enum AwsRegion {
110-
/// Defer region detection to an auto-discovery mechanism.
111-
Source(AwsRegionAutoDiscovery),
112-
113-
/// An explicit region, eg: eu-central-1
114-
Name(String),
115-
}
116-
117-
impl AwsRegion {
118-
/// Get the AWS region name.
119-
///
120-
/// Returns `None` if an auto-discovery source has been selected. Otherwise,
121-
/// it returns the configured region name.
122-
///
123-
/// Example usage:
124-
///
125-
/// ```
126-
/// # use stackable_operator::commons::s3::AwsRegion;
127-
/// # fn set_property(key: &str, value: &str) {}
128-
/// # fn example(aws_region: AwsRegion) {
129-
/// if let Some(region_name) = aws_region.name() {
130-
/// // set some property if the region is set, or is the default.
131-
/// set_property("aws.region", region_name);
132-
/// };
133-
/// # }
134-
/// ```
135-
pub fn name(&self) -> Option<&str> {
136-
match self {
137-
AwsRegion::Name(name) => Some(name),
138-
AwsRegion::Source(_) => None,
139-
}
140-
}
100+
pub struct Region {
101+
#[serde(default = "default_region_name")]
102+
pub name: String,
141103
}
142104

143-
impl Default for AwsRegion {
105+
impl Default for Region {
144106
fn default() -> Self {
145-
Self::Name("us-east-1".to_owned())
107+
Self {
108+
name: default_region_name(),
109+
}
146110
}
147111
}
148112

149-
/// AWS region auto-discovery mechanism.
150-
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
151-
#[serde(rename_all = "PascalCase")]
152-
pub enum AwsRegionAutoDiscovery {
153-
/// AWS Instance Meta Data Service.
154-
///
155-
/// This variant should result in no region being given to the AWS SDK,
156-
/// which should, in turn, query the AWS IMDS.
157-
AwsImds,
113+
fn default_region_name() -> String {
114+
"us-east-1".into()
158115
}

crates/stackable-operator/src/config/fragment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct Validator<'a> {
2626
parent: Option<&'a Validator<'a>>,
2727
}
2828

29-
impl<'a> Validator<'a> {
29+
impl Validator<'_> {
3030
/// Creates a `Validator` for a subfield of the current object
3131
pub fn field<'b>(&'b self, ident: &'b dyn Display) -> Validator<'b> {
3232
Validator {

crates/stackable-operator/src/config/merge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl Atomic for bool {}
146146
impl Atomic for String {}
147147
impl Atomic for Quantity {}
148148
impl Atomic for Duration {}
149-
impl<'a> Atomic for &'a str {}
149+
impl Atomic for &str {}
150150
impl Atomic for LabelSelector {}
151151
impl Atomic for PodAffinity {}
152152
impl Atomic for PodAntiAffinity {}

crates/stackable-operator/src/cpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'de> Deserialize<'de> for CpuQuantity {
7070
{
7171
struct CpuQuantityVisitor;
7272

73-
impl<'de> Visitor<'de> for CpuQuantityVisitor {
73+
impl Visitor<'_> for CpuQuantityVisitor {
7474
type Value = CpuQuantity;
7575

7676
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

crates/stackable-operator/src/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'de> Deserialize<'de> for MemoryQuantity {
347347
{
348348
struct MemoryQuantityVisitor;
349349

350-
impl<'de> Visitor<'de> for MemoryQuantityVisitor {
350+
impl Visitor<'_> for MemoryQuantityVisitor {
351351
type Value = MemoryQuantity;
352352

353353
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

0 commit comments

Comments
 (0)