@@ -93,16 +93,18 @@ def _adjust_missing_values(self, helm_values):
9393 chart_idx_content = yaml .safe_load (f )
9494 helm_values ['name' ] = chart_idx_content ['name' ].lower ()
9595
96- def _process_applications (self , helm_values , base_image_name ):
97- for root_path in self .root_paths :
96+ def _process_applications (self , helm_values , base_image_name = None ):
97+ for i in range (len (self .root_paths )):
98+ root_path = self .root_paths [i ]
99+ base_name = clean_image_name (root_path .name ) if i > 0 else base_image_name
98100 app_values = init_app_values (
99101 root_path , exclude = self .exclude , values = helm_values [KEY_APPS ])
100102 helm_values [KEY_APPS ] = dict_merge (helm_values [KEY_APPS ],
101103 app_values )
102104
103105 app_base_path = root_path / APPS_PATH
104106 app_values = self .collect_app_values (
105- app_base_path , base_image_name = clean_image_name ( root_path . name ) , helm_values = helm_values )
107+ app_base_path , base_image_name = base_name , helm_values = helm_values )
106108 helm_values [KEY_APPS ] = dict_merge (helm_values [KEY_APPS ],
107109 app_values )
108110
@@ -147,13 +149,15 @@ def collect_app_values(self, app_base_path, base_image_name=None, helm_values=No
147149
148150 return values
149151
150- def _init_static_images (self ):
151- for root_path in self .root_paths :
152+ def _init_static_images (self , base_image_name ):
153+ for i in range (len (self .root_paths )):
154+ root_path = self .root_paths [i ]
155+ base_name = clean_image_name (root_path .name ) if i > 0 else base_image_name
152156 for static_img_dockerfile in find_dockerfiles_paths (os .path .join (root_path , STATIC_IMAGES_PATH )):
153157 self .static_images .add (static_img_dockerfile )
154158
155159 img_name = image_name_from_dockerfile_path (os .path .basename (
156- static_img_dockerfile ), base_name = clean_image_name ( root_path . name ) )
160+ static_img_dockerfile ), base_name = base_name )
157161 self .base_images [os .path .basename (static_img_dockerfile )] = self .image_tag (
158162 img_name , build_context_path = static_img_dockerfile ,
159163 dependencies = guess_build_dependencies_from_dockerfile (static_img_dockerfile )
@@ -178,25 +182,30 @@ def _assign_static_build_dependencies(self, helm_values):
178182 del helm_values [KEY_TASK_IMAGES ][image_name ]
179183 # del helm_values[KEY_TASK_IMAGES_BUILD][image_name]
180184
181- def _init_base_images (self ):
185+ def _init_base_images (self , base_image_name ):
186+ for i in range (len (self .root_paths )):
187+ root_path = self .root_paths [i ]
188+ base_name = clean_image_name (root_path .name ) if i > 0 else base_image_name
182189
183- for root_path in self .root_paths :
184190 for base_img_dockerfile in self .__find_static_dockerfile_paths (root_path ):
185191 img_name = image_name_from_dockerfile_path (
186- os .path .basename (base_img_dockerfile ), base_name = clean_image_name ( root_path . name ) )
192+ os .path .basename (base_img_dockerfile ), base_name = base_name )
187193 self .base_images [os .path .basename (base_img_dockerfile )] = self .image_tag (
188194 img_name , build_context_path = root_path ,
189195 dependencies = guess_build_dependencies_from_dockerfile (base_img_dockerfile )
190196 )
191197
192198 return self .base_images
193199
194- def _init_test_images (self ):
200+ def _init_test_images (self , base_image_name ):
195201 test_images = {}
196- for root_path in self .root_paths :
202+ for i in range (len (self .root_paths )):
203+ root_path = self .root_paths [i ]
204+ base_name = clean_image_name (root_path .name ) if i > 0 else base_image_name
205+
197206 for base_img_dockerfile in find_dockerfiles_paths (os .path .join (root_path , TEST_IMAGES_PATH )):
198207 img_name = image_name_from_dockerfile_path (
199- os .path .basename (base_img_dockerfile ), base_name = clean_image_name ( root_path . name ) )
208+ os .path .basename (base_img_dockerfile ), base_name = base_name )
200209 test_images [os .path .basename (base_img_dockerfile )] = self .image_tag (
201210 img_name , build_context_path = base_img_dockerfile )
202211
0 commit comments