@@ -24,6 +24,7 @@ use stackable_operator::{
2424 security:: PodSecurityContextBuilder , volume:: VolumeBuilder ,
2525 } ,
2626 } ,
27+ cli:: OperatorEnvironmentOptions ,
2728 cluster_resources:: { ClusterResourceApplyStrategy , ClusterResources } ,
2829 commons:: {
2930 opa:: OpaApiVersion ,
@@ -95,7 +96,7 @@ use crate::{
9596pub const DRUID_CONTROLLER_NAME : & str = "druidcluster" ;
9697pub const FULL_CONTROLLER_NAME : & str = concatcp ! ( DRUID_CONTROLLER_NAME , '.' , OPERATOR_NAME ) ;
9798
98- const DOCKER_IMAGE_BASE_NAME : & str = "druid" ;
99+ const CONTAINER_IMAGE_BASE_NAME : & str = "druid" ;
99100
100101// volume names
101102const DRUID_CONFIG_VOLUME_NAME : & str = "config" ;
@@ -108,6 +109,7 @@ const USERDATA_MOUNTPOINT: &str = "/stackable/userdata";
108109pub struct Ctx {
109110 pub client : stackable_operator:: client:: Client ,
110111 pub product_config : ProductConfigManager ,
112+ pub operator_environment : OperatorEnvironmentOptions ,
111113}
112114
113115#[ derive( Snafu , Debug , EnumDiscriminants ) ]
@@ -414,7 +416,11 @@ pub async fn reconcile_druid(
414416 let resolved_product_image = druid
415417 . spec
416418 . image
417- . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION )
419+ . resolve (
420+ CONTAINER_IMAGE_BASE_NAME ,
421+ & ctx. operator_environment . image_repository ,
422+ crate :: built_info:: PKG_VERSION ,
423+ )
418424 . context ( ResolveProductImageSnafu ) ?;
419425
420426 let zk_confmap = druid. spec . cluster_config . zookeeper_config_map_name . clone ( ) ;
@@ -1421,7 +1427,11 @@ mod test {
14211427 let resolved_product_image: ResolvedProductImage = druid
14221428 . spec
14231429 . image
1424- . resolve ( DOCKER_IMAGE_BASE_NAME , crate :: built_info:: PKG_VERSION )
1430+ . resolve (
1431+ CONTAINER_IMAGE_BASE_NAME ,
1432+ "oci.example.org" ,
1433+ crate :: built_info:: PKG_VERSION ,
1434+ )
14251435 . expect ( "test: resolved product image is always valid" ) ;
14261436 let role_config = transform_all_roles_to_config ( & druid, & druid. build_role_properties ( ) ) ;
14271437
0 commit comments