@@ -6,6 +6,7 @@ use stackable_operator::{
66 commons:: tls_verification:: { CaCert , TlsServerVerification , TlsVerification } ,
77 crd:: s3,
88 k8s_openapi:: api:: core:: v1:: ConfigMap ,
9+ v2:: types:: kubernetes:: NamespaceName ,
910} ;
1011
1112use super :: {
@@ -14,7 +15,7 @@ use super::{
1415 from_trino_catalog_error:: {
1516 ConfigureS3Snafu , FailedToGetDiscoveryConfigMapDataKeySnafu ,
1617 FailedToGetDiscoveryConfigMapDataSnafu , FailedToGetDiscoveryConfigMapSnafu ,
17- ObjectHasNoNamespaceSnafu , S3TlsNoVerificationNotSupportedSnafu , S3TlsRequiredSnafu ,
18+ S3TlsNoVerificationNotSupportedSnafu , S3TlsRequiredSnafu ,
1819 } ,
1920} ;
2021use crate :: {
@@ -31,17 +32,12 @@ impl ExtendCatalogConfig for MetastoreConnection {
3132 & self ,
3233 catalog_config : & mut CatalogConfig ,
3334 catalog_name : & str ,
34- catalog_namespace : Option < String > ,
35+ catalog_namespace : & NamespaceName ,
3536 client : & Client ,
3637 _trino_version : u16 ,
3738 ) -> Result < ( ) , FromTrinoCatalogError > {
3839 let hive_cm: ConfigMap = client
39- . get (
40- & self . config_map ,
41- catalog_namespace
42- . as_deref ( )
43- . context ( ObjectHasNoNamespaceSnafu ) ?,
44- )
40+ . get ( & self . config_map , catalog_namespace. as_ref ( ) )
4541 . await
4642 . with_context ( |_| FailedToGetDiscoveryConfigMapSnafu {
4743 catalog : catalog_name. to_string ( ) ,
@@ -78,18 +74,13 @@ impl ExtendCatalogConfig for s3::v1alpha1::InlineConnectionOrReference {
7874 & self ,
7975 catalog_config : & mut CatalogConfig ,
8076 _catalog_name : & str ,
81- catalog_namespace : Option < String > ,
77+ catalog_namespace : & NamespaceName ,
8278 client : & Client ,
8379 trino_version : u16 ,
8480 ) -> Result < ( ) , FromTrinoCatalogError > {
8581 let s3 = self
8682 . clone ( )
87- . resolve (
88- client,
89- catalog_namespace
90- . as_deref ( )
91- . context ( ObjectHasNoNamespaceSnafu ) ?,
92- )
83+ . resolve ( client, catalog_namespace. as_ref ( ) )
9384 . await
9485 . context ( ConfigureS3Snafu ) ?;
9586
@@ -168,7 +159,7 @@ impl ExtendCatalogConfig for HdfsConnection {
168159 & self ,
169160 catalog_config : & mut CatalogConfig ,
170161 catalog_name : & str ,
171- _catalog_namespace : Option < String > ,
162+ _catalog_namespace : & NamespaceName ,
172163 _client : & Client ,
173164 _trino_version : u16 ,
174165 ) -> Result < ( ) , FromTrinoCatalogError > {
0 commit comments