@@ -18,7 +18,10 @@ use stackable_operator::{
1818 } ,
1919 client:: Client ,
2020 cluster_resources:: { ClusterResourceApplyStrategy , ClusterResources } ,
21- commons:: { product_image_selection:: ResolvedProductImage , rbac:: build_rbac_resources} ,
21+ commons:: {
22+ product_image_selection:: { self , ResolvedProductImage } ,
23+ rbac:: build_rbac_resources,
24+ } ,
2225 iter:: reverse_if,
2326 k8s_openapi:: {
2427 DeepMerge ,
@@ -38,14 +41,14 @@ use stackable_operator::{
3841 logging:: controller:: ReconcilerError ,
3942 product_config_utils:: { transform_all_roles_to_config, validate_all_roles_and_groups_config} ,
4043 role_utils:: { GenericRoleConfig , RoleGroupRef } ,
44+ shared:: time:: Duration ,
4145 status:: {
4246 condition:: {
4347 compute_conditions, operations:: ClusterOperationsConditionBuilder ,
4448 statefulset:: StatefulSetConditionBuilder ,
4549 } ,
4650 rollout:: check_statefulset_rollout_complete,
4751 } ,
48- time:: Duration ,
4952 utils:: cluster_info:: KubernetesClusterInfo ,
5053} ;
5154use strum:: { EnumDiscriminants , IntoEnumIterator , IntoStaticStr } ;
@@ -242,6 +245,11 @@ pub enum Error {
242245 InvalidHdfsCluster {
243246 source : error_boundary:: InvalidObject ,
244247 } ,
248+
249+ #[ snafu( display( "failed to resolve product image" ) ) ]
250+ ResolveProductImage {
251+ source : product_image_selection:: Error ,
252+ } ,
245253}
246254
247255impl ReconcilerError for Error {
@@ -274,7 +282,8 @@ pub async fn reconcile_hdfs(
274282 let resolved_product_image = hdfs
275283 . spec
276284 . image
277- . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION ) ;
285+ . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION )
286+ . context ( ResolveProductImageSnafu ) ?;
278287
279288 let validated_config = validate_all_roles_and_groups_config (
280289 & resolved_product_image. product_version ,
@@ -396,7 +405,7 @@ pub async fn reconcile_hdfs(
396405 . with_recommended_labels ( build_recommended_labels (
397406 hdfs,
398407 RESOURCE_MANAGER_HDFS_CONTROLLER ,
399- & resolved_product_image. app_version_label ,
408+ & resolved_product_image. app_version_label_value ,
400409 & rolegroup_ref. role ,
401410 & rolegroup_ref. role_group ,
402411 ) )
@@ -1007,7 +1016,11 @@ properties: []
10071016 let env_overrides = rolegroup_config. get ( & PropertyNameKind :: Env ) ;
10081017
10091018 let merged_config = role. merged_config ( & hdfs, "default" ) . unwrap ( ) ;
1010- let resolved_product_image = hdfs. spec . image . resolve ( DOCKER_IMAGE_BASE_NAME , "0.0.0-dev" ) ;
1019+ let resolved_product_image = hdfs
1020+ . spec
1021+ . image
1022+ . resolve ( DOCKER_IMAGE_BASE_NAME , "0.0.0-dev" )
1023+ . expect ( "test resolved product image is always valid" ) ;
10111024
10121025 let mut pb = PodBuilder :: new ( ) ;
10131026 pb. metadata ( ObjectMeta :: default ( ) ) ;
0 commit comments