@@ -212,7 +212,7 @@ func compatibleComponent(c v1alpha1.ZarfComponent, arch, flavor string) bool {
212
212
}
213
213
214
214
// TODO (phillebaba): Refactor package structure so that pullOCI can be used instead.
215
- func fetchOCISkeleton (ctx context.Context , component v1alpha1.ZarfComponent , packagePath string , cachePath string ) (string , error ) {
215
+ func fetchOCISkeleton (ctx context.Context , component v1alpha1.ZarfComponent , packagePath string , cachePath string ) (_ string , err error ) {
216
216
if component .Import .URL == "" {
217
217
return component .Import .Path , nil
218
218
}
@@ -255,11 +255,18 @@ func fetchOCISkeleton(ctx context.Context, component v1alpha1.ZarfComponent, pac
255
255
if err != nil {
256
256
return "" , err
257
257
}
258
- defer os .RemoveAll (tempDir )
258
+ defer func () {
259
+ err = errors .Join (err , os .RemoveAll (tempDir ))
260
+ }()
259
261
// FIXME: once oci PR is merged this is unnecessary
260
- if err := os .Mkdir (filepath .Join (tempDir , "components" ), helpers .ReadWriteExecuteUser ); err != nil {
261
- return "" , err
262
- }
262
+ // if err := os.Mkdir(filepath.Join(tempDir, "components"), helpers.ReadWriteExecuteUser); err != nil {
263
+ // return "", err
264
+ // }
265
+ // Annotation titles generally look like 'components/component-name.tar'
266
+
267
+ // The problem is we still essentially need the cache as a place to put the skeleton image
268
+ // The only other way would be to store it in a temp directory then when cleaning up after the package is finished we delete that temp directory
269
+ fmt .Println ("this is the digest" , componentDesc .Digest .Encoded ())
263
270
tarball = filepath .Join (tempDir , componentDesc .Annotations [ocispec .AnnotationTitle ])
264
271
dir = filepath .Join (cache , "dirs" , componentDesc .Digest .Encoded ())
265
272
err = remote .PullPath (ctx , tempDir , componentDesc )
0 commit comments