@@ -105,17 +105,18 @@ impl ProductImage {
105
105
let image_pull_policy = self . pull_policy . as_ref ( ) . to_string ( ) ;
106
106
let pull_secrets = self . pull_secrets . clone ( ) ;
107
107
108
+ let product_version = self . product_version ( ) . to_owned ( ) ;
109
+
108
110
match & self . image_selection {
109
111
ProductImageSelection :: Custom ( image_selection) => {
110
112
let image = ImageRef :: parse ( & image_selection. custom ) ;
111
113
let image_tag_or_hash = image. tag . or ( image. hash ) . unwrap_or ( "latest" . to_string ( ) ) ;
112
- let mut app_version_label =
113
- format ! ( "{}-{}" , image_selection. product_version, image_tag_or_hash) ;
114
+ let mut app_version_label = format ! ( "{}-{}" , product_version, image_tag_or_hash) ;
114
115
// TODO Use new label mechanism once added
115
116
app_version_label. truncate ( 63 ) ;
116
117
117
118
ResolvedProductImage {
118
- product_version : image_selection . product_version . to_string ( ) ,
119
+ product_version,
119
120
app_version_label,
120
121
image : image_selection. custom . clone ( ) ,
121
122
image_pull_policy,
@@ -145,14 +146,10 @@ impl ProductImage {
145
146
} ;
146
147
let image = format ! (
147
148
"{repo}/{image_base_name}:{product_version}-stackable{stackable_version}" ,
148
- product_version = image_selection. product_version,
149
- ) ;
150
- let app_version_label = format ! (
151
- "{product_version}-stackable{stackable_version}" ,
152
- product_version = image_selection. product_version,
153
149
) ;
150
+ let app_version_label = format ! ( "{product_version}-stackable{stackable_version}" , ) ;
154
151
ResolvedProductImage {
155
- product_version : image_selection . product_version . to_string ( ) ,
152
+ product_version,
156
153
app_version_label,
157
154
image,
158
155
image_pull_policy,
@@ -163,6 +160,8 @@ impl ProductImage {
163
160
}
164
161
165
162
/// The product version is always known without having to resolve the image.
163
+ /// In the future we might have a more clever version, which let's the operator pick a recommended product version
164
+ /// automatically, e.g. from the LTS release line.
166
165
pub fn product_version ( & self ) -> & str {
167
166
match & self . image_selection {
168
167
ProductImageSelection :: Custom ( ProductImageCustom {
0 commit comments