@@ -239,30 +239,31 @@ impl ProductImage {
239239 // Trim the end to ensure no double slashes are produced below
240240 . trim_end_matches ( '/' ) ;
241241
242+ // First, figure out which version should be used. If the user explicitly specified
243+ // a version, use that directly. If no explicit version is set, we need to fall back
244+ // to the operator version. 0.0.0-pr* as the operator version results in the product
245+ // version to use 0.0.0-dev. In all other cases, the operator version is used as is.
242246 let stackable_version = match stackable_version {
243247 Some ( version) => version,
244248 None => {
245- if operator_version. major == 0
246- && operator_version. minor == 0
247- && operator_version. patch == 0
248- && operator_version. pre . starts_with ( "pr" )
249- {
249+ if operator_version. is_0_0_0_pr ( ) {
250250 tracing:: warn!(
251251 %operator_version,
252252 "operator is built by pull request, using {version} build of product image" ,
253253 version = * ZERO_ZERO_ZERO_DEV
254254 ) ;
255255
256- is_floating_tag = true ;
257256 & * ZERO_ZERO_ZERO_DEV
258257 } else {
259258 operator_version
260259 }
261260 }
262261 } ;
263262
263+ // Determine if the selected stackable version is considered floating once.
264+ is_floating_tag = stackable_version. is_floating ( ) || * use_floating_tag;
265+
264266 let stackable_version = if * use_floating_tag {
265- is_floating_tag = true ;
266267 stackable_version. floating ( )
267268 } else {
268269 stackable_version. to_string ( )
@@ -383,7 +384,7 @@ mod tests {
383384 image: "oci.stackable.tech/sdp/superset:1.4.1-stackable0.0.0-dev" . to_string( ) ,
384385 app_version_label_value: "1.4.1-stackable0.0.0-dev" . parse( ) . expect( "static app version label is always valid" ) ,
385386 product_version: "1.4.1" . to_string( ) ,
386- image_pull_policy: "IfNotPresent " . to_string( ) ,
387+ image_pull_policy: "Always " . to_string( ) ,
387388 pull_secrets: None ,
388389 }
389390 ) ]
0 commit comments