diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ce169e..7b234e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ All notable changes to this project will be documented in this file. - BREAKING: The field `opa` in `authorization` is now a mandatory enum variant instead of being optional ([#827]). - BREAKING: The operator no longer sets `opa.policy.column-masking-uri` in `access-control.properties` but `opa.policy.batch-column-masking-uri` instead, allowing Trino to fetch multiple column masks in a single request ([#827]). +- Make `TrinoCatalog.spec.connector.iceberg.metastore` optional, as Iceberg also supports other catalogs, such as a REST catalog, + which (currently) can only be added using configOverrides ([#841]). ### Removed @@ -28,6 +30,7 @@ All notable changes to this project will be documented in this file. [#831]: https://github.com/stackabletech/trino-operator/pull/831 [#833]: https://github.com/stackabletech/trino-operator/pull/833 [#839]: https://github.com/stackabletech/trino-operator/pull/839 +[#841]: https://github.com/stackabletech/trino-operator/pull/841 ## [25.11.0] - 2025-11-07 diff --git a/deploy/helm/trino-operator/crds/crds.yaml b/deploy/helm/trino-operator/crds/crds.yaml index 5ccd3d67..236906aa 100644 --- a/deploy/helm/trino-operator/crds/crds.yaml +++ b/deploy/helm/trino-operator/crds/crds.yaml @@ -2810,7 +2810,12 @@ spec: - configMap type: object metastore: - description: Mandatory connection to a Hive Metastore, which will be used as a storage for metadata. + description: |- + Optional connection to a Hive Metastore, which will be used as a storage for metadata. + + The connection is optional, as Iceberg also supports other catalogs, such as a REST catalog, + which (currently) can only be added using configOverrides. + nullable: true properties: configMap: description: Name of the [discovery ConfigMap](https://docs.stackable.tech/home/nightly/concepts/service_discovery) providing information about the Hive metastore. @@ -2970,8 +2975,6 @@ spec: reference: type: string type: object - required: - - metastore type: object tpcds: description: A [TPC-DS](https://docs.stackable.tech/home/nightly/trino/usage-guide/catalogs/tpcds) connector. diff --git a/rust/operator-binary/src/catalog/iceberg.rs b/rust/operator-binary/src/catalog/iceberg.rs index 114c268f..4ab4498a 100644 --- a/rust/operator-binary/src/catalog/iceberg.rs +++ b/rust/operator-binary/src/catalog/iceberg.rs @@ -24,15 +24,17 @@ impl ToCatalogConfig for IcebergConnector { // See https://trino.io/docs/current/connector/iceberg.html config.add_property("iceberg.security", "allow-all"); - self.metastore - .extend_catalog_config( - &mut config, - catalog_name, - catalog_namespace.clone(), - client, - trino_version, - ) - .await?; + if let Some(metastore) = &self.metastore { + metastore + .extend_catalog_config( + &mut config, + catalog_name, + catalog_namespace.clone(), + client, + trino_version, + ) + .await?; + } if let Some(ref s3) = self.s3 { s3.extend_catalog_config( diff --git a/rust/operator-binary/src/crd/affinity.rs b/rust/operator-binary/src/crd/affinity.rs index fecef696..cac09f42 100644 --- a/rust/operator-binary/src/crd/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -22,7 +22,10 @@ pub fn get_affinity( .iter() .filter_map(|catalog| match &catalog.spec.connector { TrinoCatalogConnector::Hive(hive) => Some(&hive.metastore.config_map), - TrinoCatalogConnector::Iceberg(iceberg) => Some(&iceberg.metastore.config_map), + TrinoCatalogConnector::Iceberg(iceberg) => iceberg + .metastore + .as_ref() + .map(|metastore| &metastore.config_map), TrinoCatalogConnector::DeltaLake(delta_lake) => { Some(&delta_lake.metastore.config_map) } diff --git a/rust/operator-binary/src/crd/catalog/iceberg.rs b/rust/operator-binary/src/crd/catalog/iceberg.rs index 56e7f333..1b0425ae 100644 --- a/rust/operator-binary/src/crd/catalog/iceberg.rs +++ b/rust/operator-binary/src/crd/catalog/iceberg.rs @@ -11,8 +11,11 @@ use super::commons::{HdfsConnection, MetastoreConnection}; #[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct IcebergConnector { - /// Mandatory connection to a Hive Metastore, which will be used as a storage for metadata. - pub metastore: MetastoreConnection, + /// Optional connection to a Hive Metastore, which will be used as a storage for metadata. + /// + /// The connection is optional, as Iceberg also supports other catalogs, such as a REST catalog, + /// which (currently) can only be added using configOverrides. + pub metastore: Option, /// Connection to an S3 store. /// Please make sure that the underlying Hive metastore also has access to the S3 store.