Skip to content

Commit f0d1b50

Browse files
committed
feat!: remove explicit Azure and GCS support
1 parent ab2d44d commit f0d1b50

File tree

2 files changed

+8
-199
lines changed

2 files changed

+8
-199
lines changed

deploy/helm/trino-operator/crds/crds.yaml

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -123,46 +123,11 @@ spec:
123123
oneOf:
124124
- required:
125125
- s3
126-
- required:
127-
- azure
128126
- required:
129127
- hdfs
130128
- required:
131129
- local
132130
properties:
133-
azure:
134-
description: Azure Blob Storage configuration.
135-
properties:
136-
baseDirectories:
137-
description: Azure Blob Storage container URIs for spooling data.
138-
items:
139-
type: string
140-
type: array
141-
blockSize:
142-
description: Block data size for Azure block blob parallel upload.
143-
nullable: true
144-
type: string
145-
endpoint:
146-
description: Azure blob endpoint URL (optional, used instead of connection string).
147-
nullable: true
148-
type: string
149-
key:
150-
description: Key name in the Secret that contains the connection string.
151-
nullable: true
152-
type: string
153-
maxErrorRetries:
154-
description: Maximum number of times the Azure client should retry a request.
155-
format: uint32
156-
minimum: 0.0
157-
nullable: true
158-
type: integer
159-
secretClass:
160-
description: '[SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) providing the Azure connection string.'
161-
type: string
162-
required:
163-
- baseDirectories
164-
- secretClass
165-
type: object
166131
hdfs:
167132
description: HDFS-based exchange manager.
168133
properties:
@@ -204,10 +169,10 @@ spec:
204169
- baseDirectories
205170
type: object
206171
s3:
207-
description: S3-compatible storage configuration (includes AWS S3, MinIO, GCS).
172+
description: S3-compatible storage configuration.
208173
properties:
209174
baseDirectories:
210-
description: S3 bucket URIs for spooling data (e.g., s3://bucket1,s3://bucket2). For GCS, use gs:// URIs (e.g., gs://bucket1,gs://bucket2).
175+
description: S3 bucket URIs for spooling data (e.g., s3://bucket1,s3://bucket2).
211176
items:
212177
type: string
213178
type: array
@@ -337,20 +302,6 @@ spec:
337302
description: External ID for the IAM role trust policy.
338303
nullable: true
339304
type: string
340-
gcsServiceAccountKey:
341-
description: Google Cloud Storage service account key in JSON format. Required when using GCS (gs:// URIs). Should contain the JSON service account key. The operator will mount this as a file and configure `exchange.gcs.json-key-file-path`.
342-
nullable: true
343-
properties:
344-
key:
345-
description: Key name in the Secret that contains the JSON service account key.
346-
nullable: true
347-
type: string
348-
secretClass:
349-
description: '[SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) providing the GCS service account key.'
350-
type: string
351-
required:
352-
- secretClass
353-
type: object
354305
iamRole:
355306
description: IAM role to assume for S3 access.
356307
nullable: true
@@ -400,8 +351,9 @@ spec:
400351
type: integer
401352
retryDelayScaleFactor:
402353
description: Factor by which retry delay is increased on each query or task failure.
354+
format: float
403355
nullable: true
404-
type: string
356+
type: number
405357
retryInitialDelay:
406358
description: Minimum time that a failed query or task must wait before it is retried.
407359
nullable: true
@@ -413,8 +365,8 @@ spec:
413365
retryPolicy:
414366
description: The retry policy for fault tolerant execution. `QUERY` retries entire queries, `TASK` retries individual tasks. When set to `TASK`, an exchange manager must be configured.
415367
enum:
416-
- QUERY
417-
- TASK
368+
- query
369+
- task
418370
type: string
419371
taskRetryAttemptsPerTask:
420372
description: Maximum number of times Trino may attempt to retry a single task before declaring the query failed. Only applies to `TASK` retry policy.

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

Lines changed: 2 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::collections::BTreeMap;
1010
use serde::{Deserialize, Serialize};
1111
use snafu::Snafu;
1212
use stackable_operator::{
13-
builder::pod::volume::{SecretOperatorVolumeSourceBuilder, VolumeBuilder, VolumeMountBuilder},
13+
builder::pod::volume::{VolumeBuilder, VolumeMountBuilder},
1414
client::Client,
1515
commons::tls_verification::{CaCert, TlsServerVerification, TlsVerification},
1616
crd::s3,
@@ -116,10 +116,8 @@ pub struct ExchangeManagerGeneralConfig {
116116
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
117117
#[serde(rename_all = "camelCase")]
118118
pub enum ExchangeManagerBackend {
119-
/// S3-compatible storage configuration (includes AWS S3, MinIO, GCS).
119+
/// S3-compatible storage configuration.
120120
S3(S3ExchangeConfig),
121-
/// Azure Blob Storage configuration.
122-
Azure(AzureExchangeConfig),
123121
/// HDFS-based exchange manager.
124122
Hdfs(HdfsExchangeConfig),
125123
/// Local filesystem storage (not recommended for production).
@@ -130,7 +128,6 @@ pub enum ExchangeManagerBackend {
130128
#[serde(rename_all = "camelCase")]
131129
pub struct S3ExchangeConfig {
132130
/// S3 bucket URIs for spooling data (e.g., s3://bucket1,s3://bucket2).
133-
/// For GCS, use gs:// URIs (e.g., gs://bucket1,gs://bucket2).
134131
pub base_directories: Vec<String>,
135132
/// S3 connection configuration.
136133
/// Learn more about S3 configuration in the [S3 concept docs](DOCS_BASE_URL_PLACEHOLDER/concepts/s3).
@@ -147,42 +144,6 @@ pub struct S3ExchangeConfig {
147144
/// Part data size for S3 multi-part upload.
148145
#[serde(skip_serializing_if = "Option::is_none")]
149146
pub upload_part_size: Option<String>,
150-
/// Google Cloud Storage service account key in JSON format.
151-
/// Required when using GCS (gs:// URIs). Should contain the JSON service account key.
152-
/// The operator will mount this as a file and configure `exchange.gcs.json-key-file-path`.
153-
#[serde(skip_serializing_if = "Option::is_none")]
154-
pub gcs_service_account_key: Option<GcsServiceAccountKey>,
155-
}
156-
157-
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
158-
#[serde(rename_all = "camelCase")]
159-
pub struct GcsServiceAccountKey {
160-
/// [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) providing the GCS service account key.
161-
pub secret_class: String,
162-
/// Key name in the Secret that contains the JSON service account key.
163-
#[serde(skip_serializing_if = "Option::is_none")]
164-
pub key: Option<String>,
165-
}
166-
167-
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
168-
#[serde(rename_all = "camelCase")]
169-
pub struct AzureExchangeConfig {
170-
/// Azure Blob Storage container URIs for spooling data.
171-
pub base_directories: Vec<String>,
172-
/// [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) providing the Azure connection string.
173-
pub secret_class: String,
174-
/// Key name in the Secret that contains the connection string.
175-
#[serde(skip_serializing_if = "Option::is_none")]
176-
pub key: Option<String>,
177-
/// Azure blob endpoint URL (optional, used instead of connection string).
178-
#[serde(skip_serializing_if = "Option::is_none")]
179-
pub endpoint: Option<String>,
180-
/// Block data size for Azure block blob parallel upload.
181-
#[serde(skip_serializing_if = "Option::is_none")]
182-
pub block_size: Option<String>,
183-
/// Maximum number of times the Azure client should retry a request.
184-
#[serde(skip_serializing_if = "Option::is_none")]
185-
pub max_error_retries: Option<u32>,
186147
}
187148

188149
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
@@ -219,11 +180,6 @@ pub enum Error {
219180

220181
#[snafu(display("trino does not support disabling the TLS verification of S3 servers"))]
221182
S3TlsNoVerificationNotSupported,
222-
223-
#[snafu(display("Failed to build Azure SecretClass volume"))]
224-
AzureSecretClassVolumeBuild {
225-
source: stackable_operator::builder::pod::volume::SecretOperatorVolumeSourceBuilderError,
226-
},
227183
}
228184

229185
/// Fault tolerant execution configuration with external resources resolved
@@ -366,32 +322,6 @@ impl ResolvedFaultTolerantExecutionConfig {
366322
s3_config.upload_part_size.as_ref(),
367323
);
368324
}
369-
ExchangeManagerBackend::Azure(azure_config) => {
370-
exchange_manager_properties.insert(
371-
"exchange-manager.name".to_string(),
372-
"filesystem".to_string(),
373-
);
374-
exchange_manager_properties.insert(
375-
"exchange.base-directories".to_string(),
376-
azure_config.base_directories.join(","),
377-
);
378-
379-
Self::insert_if_present(
380-
&mut exchange_manager_properties,
381-
"exchange.azure.endpoint",
382-
azure_config.endpoint.as_ref(),
383-
);
384-
Self::insert_if_present(
385-
&mut exchange_manager_properties,
386-
"exchange.azure.block-size",
387-
azure_config.block_size.as_ref(),
388-
);
389-
Self::insert_if_present(
390-
&mut exchange_manager_properties,
391-
"exchange.azure.max-error-retries",
392-
azure_config.max_error_retries,
393-
);
394-
}
395325
ExchangeManagerBackend::Hdfs(hdfs_config) => {
396326
exchange_manager_properties
397327
.insert("exchange-manager.name".to_string(), "hdfs".to_string());
@@ -448,9 +378,6 @@ impl ResolvedFaultTolerantExecutionConfig {
448378
.resolve_s3_backend(s3_config, client, namespace)
449379
.await?;
450380
}
451-
ExchangeManagerBackend::Azure(azure_config) => {
452-
resolved_config.resolve_azure_backend(azure_config).await?;
453-
}
454381
ExchangeManagerBackend::Hdfs(hdfs_config) => {
455382
resolved_config.resolve_hdfs_backend(hdfs_config);
456383
}
@@ -541,75 +468,6 @@ impl ResolvedFaultTolerantExecutionConfig {
541468
}
542469
}
543470

544-
if let Some(gcs_key_config) = &s3_config.gcs_service_account_key {
545-
let gcs_secret_mount_dir = format!("{CONFIG_DIR_NAME}/exchange-gcs-key");
546-
let volume_name = "exchange-gcs-key".to_string();
547-
let default_key_name = "key.json".to_string();
548-
let key_name = gcs_key_config.key.as_ref().unwrap_or(&default_key_name);
549-
550-
let secret_volume_source =
551-
SecretOperatorVolumeSourceBuilder::new(&gcs_key_config.secret_class)
552-
.build()
553-
.context(AzureSecretClassVolumeBuildSnafu)?;
554-
555-
self.volumes.push(
556-
VolumeBuilder::new(&volume_name)
557-
.ephemeral(secret_volume_source)
558-
.build(),
559-
);
560-
self.volume_mounts.push(
561-
VolumeMountBuilder::new(&volume_name, &gcs_secret_mount_dir)
562-
.read_only(true)
563-
.build(),
564-
);
565-
566-
let json_key_file_path = format!("{gcs_secret_mount_dir}/{key_name}");
567-
self.exchange_manager_properties.insert(
568-
"exchange.gcs.json-key-file-path".to_string(),
569-
json_key_file_path,
570-
);
571-
}
572-
573-
Ok(())
574-
}
575-
576-
async fn resolve_azure_backend(
577-
&mut self,
578-
azure_config: &AzureExchangeConfig,
579-
) -> Result<(), Error> {
580-
use snafu::ResultExt;
581-
582-
let azure_secret_mount_dir = format!("{CONFIG_DIR_NAME}/exchange-azure-secret");
583-
let volume_name = "exchange-azure-secret".to_string();
584-
let default_key_name = "connectionString".to_string();
585-
let key_name = azure_config.key.as_ref().unwrap_or(&default_key_name);
586-
587-
let secret_volume_source =
588-
SecretOperatorVolumeSourceBuilder::new(&azure_config.secret_class)
589-
.build()
590-
.context(AzureSecretClassVolumeBuildSnafu)?;
591-
592-
self.volumes.push(
593-
VolumeBuilder::new(&volume_name)
594-
.ephemeral(secret_volume_source)
595-
.build(),
596-
);
597-
self.volume_mounts.push(
598-
VolumeMountBuilder::new(&volume_name, &azure_secret_mount_dir)
599-
.read_only(true)
600-
.build(),
601-
);
602-
603-
let connection_string_env = "EXCHANGE_AZURE_CONNECTION_STRING".to_string();
604-
self.exchange_manager_properties.insert(
605-
"exchange.azure.connection-string".to_string(),
606-
format!("${{ENV:{connection_string_env}}}"),
607-
);
608-
609-
let connection_string_path = format!("{azure_secret_mount_dir}/{key_name}");
610-
self.load_env_from_files
611-
.insert(connection_string_env, connection_string_path);
612-
613471
Ok(())
614472
}
615473

@@ -729,7 +587,6 @@ mod tests {
729587
external_id: Some("external-id-123".to_string()),
730588
max_error_retries: Some(5),
731589
upload_part_size: Some("10MB".to_string()),
732-
gcs_service_account_key: None,
733590
}),
734591
}),
735592
query_retry_attempts: None,

0 commit comments

Comments
 (0)