@@ -206,28 +206,37 @@ def stream_context_tar(topsrcdir, context_dir, out_file, args=None):
206206
207207
208208@functools .lru_cache (maxsize = None )
209- def image_paths ():
209+ def image_paths (graph_config = None ):
210210 """Return a map of image name to paths containing their Dockerfile."""
211- config = load_yaml ("taskcluster" , "kinds" , "docker-image" , "kind.yml" )
211+ if graph_config :
212+ config = load_yaml (
213+ graph_config .docker_dir ,
214+ "kinds" ,
215+ graph_config ["docker_image_kind" ],
216+ "kind.yml" ,
217+ )
218+ else :
219+ config = load_yaml ("taskcluster" , "kinds" , "docker-image" , "kind.yml" )
220+
212221 return {
213222 k : os .path .join (IMAGE_DIR , v .get ("definition" , k ))
214223 for k , v in config ["tasks" ].items ()
215224 }
216225
217226
218- def image_path (name ):
219- paths = image_paths ()
227+ def image_path (name , graph_config = None ):
228+ paths = image_paths (graph_config )
220229 if name in paths :
221230 return paths [name ]
222231 return os .path .join (IMAGE_DIR , name )
223232
224233
225234@functools .lru_cache (maxsize = None )
226- def parse_volumes (image ):
235+ def parse_volumes (image , graph_config = None ):
227236 """Parse VOLUME entries from a Dockerfile for an image."""
228237 volumes = set ()
229238
230- path = image_path (image )
239+ path = image_path (image , graph_config )
231240
232241 with open (os .path .join (path , "Dockerfile" ), "rb" ) as fh :
233242 for line in fh :
0 commit comments