@@ -26,8 +26,10 @@ use stackable_operator::{
2626 } ,
2727 cluster_resources:: { ClusterResourceApplyStrategy , ClusterResources } ,
2828 commons:: {
29- opa:: OpaApiVersion , product_image_selection:: ResolvedProductImage ,
30- rbac:: build_rbac_resources, tls_verification:: TlsClientDetailsError ,
29+ opa:: OpaApiVersion ,
30+ product_image_selection:: { self , ResolvedProductImage } ,
31+ rbac:: build_rbac_resources,
32+ tls_verification:: TlsClientDetailsError ,
3133 } ,
3234 crd:: s3,
3335 k8s_openapi:: {
@@ -55,11 +57,11 @@ use stackable_operator::{
5557 } ,
5658 } ,
5759 role_utils:: RoleGroupRef ,
60+ shared:: time:: Duration ,
5861 status:: condition:: {
5962 compute_conditions, operations:: ClusterOperationsConditionBuilder ,
6063 statefulset:: StatefulSetConditionBuilder ,
6164 } ,
62- time:: Duration ,
6365} ;
6466use strum:: { EnumDiscriminants , IntoStaticStr } ;
6567
@@ -378,6 +380,11 @@ pub enum Error {
378380
379381 #[ snafu( display( "failed to configure service" ) ) ]
380382 ServiceConfiguration { source : crate :: service:: Error } ,
383+
384+ #[ snafu( display( "failed to resolve product image" ) ) ]
385+ ResolveProductImage {
386+ source : product_image_selection:: Error ,
387+ } ,
381388}
382389
383390type Result < T , E = Error > = std:: result:: Result < T , E > ;
@@ -405,10 +412,11 @@ pub async fn reconcile_druid(
405412 . namespace
406413 . clone ( )
407414 . with_context ( || ObjectHasNoNamespaceSnafu { } ) ?;
408- let resolved_product_image: ResolvedProductImage = druid
415+ let resolved_product_image = druid
409416 . spec
410417 . image
411- . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION ) ;
418+ . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION )
419+ . context ( ResolveProductImageSnafu ) ?;
412420
413421 let zk_confmap = druid. spec . cluster_config . zookeeper_config_map_name . clone ( ) ;
414422 let zk_connstr = client
@@ -533,7 +541,7 @@ pub async fn reconcile_druid(
533541 let role_group_service_recommended_labels = build_recommended_labels (
534542 druid,
535543 DRUID_CONTROLLER_NAME ,
536- & resolved_product_image. app_version_label ,
544+ & resolved_product_image. app_version_label_value ,
537545 & rolegroup. role ,
538546 & rolegroup. role_group ,
539547 ) ;
@@ -624,7 +632,7 @@ pub async fn reconcile_druid(
624632 build_recommended_labels (
625633 druid,
626634 DRUID_CONTROLLER_NAME ,
627- & resolved_product_image. app_version_label ,
635+ & resolved_product_image. app_version_label_value ,
628636 role_name,
629637 "none" ,
630638 ) ,
@@ -857,7 +865,7 @@ fn build_rolegroup_config_map(
857865 . with_recommended_labels ( build_recommended_labels (
858866 druid,
859867 DRUID_CONTROLLER_NAME ,
860- & resolved_product_image. app_version_label ,
868+ & resolved_product_image. app_version_label_value ,
861869 & rolegroup. role ,
862870 & rolegroup. role_group ,
863871 ) )
@@ -1131,7 +1139,7 @@ fn build_rolegroup_statefulset(
11311139 . with_recommended_labels ( build_recommended_labels (
11321140 druid,
11331141 DRUID_CONTROLLER_NAME ,
1134- & resolved_product_image. app_version_label ,
1142+ & resolved_product_image. app_version_label_value ,
11351143 & rolegroup_ref. role ,
11361144 & rolegroup_ref. role_group ,
11371145 ) )
@@ -1190,7 +1198,7 @@ fn build_rolegroup_statefulset(
11901198 . with_recommended_labels ( build_recommended_labels (
11911199 druid,
11921200 DRUID_CONTROLLER_NAME ,
1193- & resolved_product_image. app_version_label ,
1201+ & resolved_product_image. app_version_label_value ,
11941202 & rolegroup_ref. role ,
11951203 & rolegroup_ref. role_group ,
11961204 ) )
@@ -1401,7 +1409,8 @@ mod test {
14011409 let resolved_product_image: ResolvedProductImage = druid
14021410 . spec
14031411 . image
1404- . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION ) ;
1412+ . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION )
1413+ . expect ( "test: resolved product image is always valid" ) ;
14051414 let role_config = transform_all_roles_to_config ( & druid, druid. build_role_properties ( ) ) ;
14061415
14071416 let product_config_manager =
0 commit comments