diff --git a/CHANGELOG.md b/CHANGELOG.md index fd0627c4..a2d30e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ### Added +- BREAKING: Add required CLI argument and env var to set the image repository used to construct final product image names: `IMAGE_REPOSITORY` (`--image-repository`), eg. `oci.example.org/my/namespace` ([#884]). - Added support for the [PostgreSQL connector](https://trino.io/docs/current/connector/postgresql.html) using the new generic database connection mechanism. Previously, users had to use the `generic` connector ([#883]). @@ -17,7 +18,7 @@ All notable changes to this project will be documented in this file. `spooling-manager.properties`). Previously arbitrary keys were silently accepted but ignored ([#878]). - Document Helm deployed RBAC permissions and remove unnecessary permissions ([#869]). -- Bump `stackable-operator` to 0.110.0 and `kube` to 3.1.0 ([#878]). +- Bump `stackable-operator` to 0.111.0 and `kube` to 3.1.0 ([#878], [#884]). ### Fixed @@ -32,6 +33,7 @@ All notable changes to this project will be documented in this file. [#876]: https://github.com/stackabletech/trino-operator/pull/876 [#878]: https://github.com/stackabletech/trino-operator/pull/878 [#883]: https://github.com/stackabletech/trino-operator/pull/883 +[#884]: https://github.com/stackabletech/trino-operator/pull/884 ## [26.3.0] - 2026-03-16 diff --git a/Cargo.lock b/Cargo.lock index af681887..9227a96e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1524,7 +1524,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "darling", "regex", @@ -2494,9 +2494,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.12" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types", @@ -2881,7 +2881,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "const-oid", "ecdsa", @@ -2904,8 +2904,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.110.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +version = "0.111.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "base64", "clap", @@ -2946,7 +2946,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "darling", "proc-macro2", @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "jiff", "k8s-openapi", @@ -2974,7 +2974,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "axum", "clap", @@ -3020,9 +3020,10 @@ dependencies = [ [[package]] name = "stackable-versioned" -version = "0.9.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +version = "0.10.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ + "kube", "schemars", "serde", "serde_json", @@ -3033,8 +3034,8 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" -version = "0.9.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +version = "0.10.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "convert_case", "convert_case_extras", @@ -3052,7 +3053,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#95490f2d703d20cf1895e5976fdc5fb8f02aa293" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 95127645..2d39a266 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4862,7 +4862,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "k8s_version"; @@ -8322,9 +8322,9 @@ rec { }; "rustls-webpki" = rec { crateName = "rustls-webpki"; - version = "0.103.12"; + version = "0.103.13"; edition = "2021"; - sha256 = "01nxzkfd1l96jzp04svc7iznlkarzx3wb9p63a0i17rc4y2vnyc2"; + sha256 = "0vkm7z9pnxz5qz66p2kmyy2pwx0g4jnsbqk5xzfhs4czcjl2ki31"; libName = "webpki"; dependencies = [ { @@ -9491,7 +9491,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "stackable_certs"; @@ -9589,12 +9589,12 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.110.0"; + version = "0.111.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "stackable_operator"; @@ -9774,7 +9774,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; procMacro = true; @@ -9809,7 +9809,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "stackable_shared"; @@ -9890,7 +9890,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "stackable_telemetry"; @@ -10096,12 +10096,12 @@ rec { }; "stackable-versioned" = rec { crateName = "stackable-versioned"; - version = "0.9.0"; + version = "0.10.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "stackable_versioned"; @@ -10109,6 +10109,12 @@ rec { "Stackable GmbH " ]; dependencies = [ + { + name = "kube"; + packageId = "kube"; + usesDefaultFeatures = false; + features = [ "client" "jsonpatch" "runtime" "derive" "admission" "rustls-tls" "ring" ]; + } { name = "schemars"; packageId = "schemars"; @@ -10140,12 +10146,12 @@ rec { }; "stackable-versioned-macros" = rec { crateName = "stackable-versioned-macros"; - version = "0.9.0"; + version = "0.10.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; procMacro = true; @@ -10213,7 +10219,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "95490f2d703d20cf1895e5976fdc5fb8f02aa293"; + rev = "b7c8a3a5483b4d35d0abfa11f6db6c153bda8a51"; sha256 = "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44"; }; libName = "stackable_webhook"; diff --git a/Cargo.toml b/Cargo.toml index 74aeb8b6..acced5f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/trino-operator" [workspace.dependencies] product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.110.0", features = ["webhook"] } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.0", features = ["webhook"] } anyhow = "1.0" async-trait = "0.1" diff --git a/crate-hashes.json b/crate-hashes.json index 1f3488f2..5a363c58 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,12 +1,12 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#k8s-version@0.1.3": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-certs@0.4.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-operator-derive@0.3.1": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-operator@0.110.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-shared@0.1.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-telemetry@0.6.3": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-versioned-macros@0.9.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-versioned@0.9.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.0#stackable-webhook@0.9.1": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#k8s-version@0.1.3": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-certs@0.4.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-operator-derive@0.3.1": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-operator@0.111.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-shared@0.1.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-telemetry@0.6.3": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-versioned-macros@0.10.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-versioned@0.10.0": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.0#stackable-webhook@0.9.1": "0svjfddsbx72mscsmg1nh581pkdb4ay8nia5gmly0wbfzj7wgq44", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/extra/crds.yaml b/extra/crds.yaml index f762ef6b..59515338 100644 --- a/extra/crds.yaml +++ b/extra/crds.yaml @@ -2195,8 +2195,9 @@ spec: properties: custom: description: |- - Overwrite the docker image. - Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0` + Provide a custom container image. + + Specify the full container image name, e.g. `oci.example.tech/namespace/superset:1.4.1-my-tag` type: string productVersion: description: Version of the product, e.g. `1.4.1`. @@ -2223,14 +2224,20 @@ spec: nullable: true type: array repo: - description: Name of the docker repo, e.g. `oci.stackable.tech/sdp` + description: |- + The repository on the container image registry where the container image is located, e.g. + `oci.example.com/namespace`. + + If not specified, the operator will use the image registry provided via the operator + environment options. nullable: true type: string stackableVersion: description: |- Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`. - If not specified, the operator will use its own version, e.g. `23.4.1`. - When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image. + + If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly + operator or a PR version, it will use the nightly `0.0.0-dev` image. nullable: true type: string type: object diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index cbe785d2..2f15aad8 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -27,6 +27,7 @@ use stackable_operator::{ volume::{SecretFormat, SecretOperatorVolumeSourceBuilder, VolumeBuilder}, }, }, + cli::OperatorEnvironmentOptions, cluster_resources::{ClusterResourceApplyStrategy, ClusterResources}, commons::{ product_image_selection::{self, ResolvedProductImage}, @@ -110,6 +111,7 @@ use crate::{ pub struct Ctx { pub client: stackable_operator::client::Client, pub product_config: ProductConfigManager, + pub operator_environment: OperatorEnvironmentOptions, } pub const OPERATOR_NAME: &str = "trino.stackable.tech"; @@ -124,7 +126,7 @@ pub const MAX_PREPARE_LOG_FILE_SIZE: MemoryQuantity = MemoryQuantity { unit: BinaryMultiple::Mebi, }; -const DOCKER_IMAGE_BASE_NAME: &str = "trino"; +const CONTAINER_IMAGE_BASE_NAME: &str = "trino"; #[derive(Snafu, Debug, EnumDiscriminants)] #[strum_discriminants(derive(IntoStaticStr))] @@ -416,7 +418,11 @@ pub async fn reconcile_trino( let resolved_product_image = trino .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION) + .resolve( + CONTAINER_IMAGE_BASE_NAME, + &ctx.operator_environment.image_repository, + crate::built_info::PKG_VERSION, + ) .context(ResolveProductImageSnafu)?; let resolved_authentication_classes = @@ -1975,7 +1981,7 @@ mod tests { let resolved_product_image = trino .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev") + .resolve(CONTAINER_IMAGE_BASE_NAME, "oci.example.org", "0.0.0-dev") .expect("test resolved product image is always valid"); let config_files = vec![ diff --git a/rust/operator-binary/src/crd/catalog/mod.rs b/rust/operator-binary/src/crd/catalog/mod.rs index c10dd80c..73df79f8 100644 --- a/rust/operator-binary/src/crd/catalog/mod.rs +++ b/rust/operator-binary/src/crd/catalog/mod.rs @@ -100,9 +100,82 @@ pub enum TrinoCatalogConnector { #[cfg(test)] mod tests { - use crate::crd::catalog::{TrinoCatalog, TrinoCatalogVersion}; + use stackable_operator::versioned::test_utils::RoundtripTestData; + + use super::{TrinoCatalog, TrinoCatalogVersion, v1alpha1}; + #[test] fn test_crd_generation() { TrinoCatalog::merged_crd(TrinoCatalogVersion::V1Alpha1).unwrap(); } + + impl RoundtripTestData for v1alpha1::TrinoCatalogSpec { + fn roundtrip_test_data() -> Vec { + stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {" + - connector: + blackHole: {} + - connector: + deltaLake: + metastore: + configMap: simple-hive + s3: + inline: + host: test-minio + port: 9000 + accessStyle: Path + credentials: + secretClass: minio-credentials + - connector: + generic: + connectorName: postgresql + properties: # optional + connection-url: + value: jdbc:postgresql://example.net:5432/database + connection-user: + valueFromSecret: + name: my-postgresql-credentials-secret + key: user + connection-password: + valueFromSecret: + name: my-postgresql-credentials-secret + key: password + - connector: + googleSheet: + credentialsSecret: gsheet-credentials + metadataSheetId: 1dT4dRWo9tAKBk5GdH-a54dcizuoxOTn98X8igZcnYr8 + cache: # optional + sheetsDataMaxCacheSize: 1000 + sheetsDataExpireAfterWrite: 5m + - connector: + hive: + metastore: + configMap: simple-hive + s3: + inline: + host: test-minio + port: 9000 + accessStyle: Path + credentials: + secretClass: minio-credentials + configOverrides: + hive.metastore.username: trino + - connector: + iceberg: + metastore: + configMap: simple-hive + s3: + inline: + host: test-minio + port: 9000 + accessStyle: Path + credentials: + secretClass: minio-credentials + - connector: + tpcds: {} + - connector: + tpch: {} + "}) + .expect("Failed to parse TrinoCatalogSpec YAML") + } + } } diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index a326a1cb..ae133dfc 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -1114,6 +1114,8 @@ impl HasStatusCondition for v1alpha1::TrinoCluster { #[cfg(test)] mod tests { + use stackable_operator::versioned::test_utils::RoundtripTestData; + use super::*; #[test] @@ -1328,4 +1330,88 @@ mod tests { Duration::from_minutes_unchecked(5) ); } + + impl RoundtripTestData for v1alpha1::TrinoClusterSpec { + fn roundtrip_test_data() -> Vec { + stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#" + - image: + productVersion: "42" + pullPolicy: IfNotPresent + clusterOperation: + stopped: false + reconciliationPaused: false + clusterConfig: + catalogLabelSelector: + matchLabels: + trino: trino + authentication: + - authenticationClass: oidc + oidc: + clientCredentialsSecret: oidc-secret + - authenticationClass: password + - authenticationClass: password-other + - authenticationClass: ldap + - authenticationClass: ldap-other + authorization: + opa: + configMapName: opa + package: trino + tls: + serverSecretClass: my-tls + internalSecretClass: null + clientProtocol: + spooling: + location: s3://spooling-bucket/trino/ + filesystem: + s3: + connection: + reference: minio + faultTolerantExecution: + task: + exchangeManager: + s3: + baseDirectories: + - s3://exchange-bucket/ + connection: + reference: minio + vectorAggregatorConfigMapName: vector-aggregator-discovery + coordinators: + config: + logging: + enableVectorAgent: true + roleConfig: + listenerClass: external-unstable + envOverrides: + COMMON_VAR: role-value + ROLE_VAR: role-value + roleGroups: + default: + replicas: 1 + envOverrides: + COMMON_VAR: group-value + GROUP_VAR: group-value + workers: + config: + resources: + cpu: + min: 300m + max: 600m + memory: + limit: 3Gi + gracefulShutdownTimeout: 5s + logging: + enableVectorAgent: true + envOverrides: + COMMON_VAR: role-value + ROLE_VAR: role-value + roleGroups: + default: + replicas: 1 + envOverrides: + COMMON_VAR: group-value + GROUP_VAR: group-value + "#}) + .expect("Failed to parse TrinoClusterSpec YAML") + } + } } diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index bd28c0d1..223765ad 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -204,6 +204,7 @@ async fn main() -> anyhow::Result<()> { controller::error_policy, Arc::new(controller::Ctx { client: client.clone(), + operator_environment, product_config, }), )