diff --git a/components/content-service/pkg/storage/gcloud.go b/components/content-service/pkg/storage/gcloud.go index 60969887536658..8d4b051c1155e3 100644 --- a/components/content-service/pkg/storage/gcloud.go +++ b/components/content-service/pkg/storage/gcloud.go @@ -192,7 +192,7 @@ func (rs *DirectGCPStorage) download(ctx context.Context, destination string, bk rc, _, err := rs.ObjectAccess(ctx, bkt, obj) if rc == nil { - return false, nil + return false, err } defer rc.Close() diff --git a/components/content-service/pkg/storage/minio.go b/components/content-service/pkg/storage/minio.go index 92c8dbcdcf874e..9d339c4f1a4535 100644 --- a/components/content-service/pkg/storage/minio.go +++ b/components/content-service/pkg/storage/minio.go @@ -205,7 +205,7 @@ func (rs *DirectMinIOStorage) download(ctx context.Context, destination string, rc, err := rs.ObjectAccess(ctx, bkt, obj) if rc == nil { - return false, nil + return false, err } defer rc.Close() diff --git a/components/ws-daemon/pkg/content/initializer.go b/components/ws-daemon/pkg/content/initializer.go index fb3452c79d6834..7babc08a66f7a4 100644 --- a/components/ws-daemon/pkg/content/initializer.go +++ b/components/ws-daemon/pkg/content/initializer.go @@ -77,7 +77,19 @@ func collectRemoteContent(ctx context.Context, rs storage.DirectAccess, ps stora rc[storage.DefaultBackup] = *backup } - if si := initializer.GetSnapshot(); si != nil { + si := initializer.GetSnapshot() + pi := initializer.GetPrebuild() + if ci := initializer.GetComposite(); ci != nil { + for _, c := range ci.Initializer { + if c.GetSnapshot() != nil { + si = c.GetSnapshot() + } + if c.GetPrebuild() != nil { + pi = c.GetPrebuild() + } + } + } + if si != nil { bkt, obj, err := storage.ParseSnapshotName(si.Snapshot) if err != nil { return nil, err @@ -92,8 +104,8 @@ func collectRemoteContent(ctx context.Context, rs storage.DirectAccess, ps stora rc[si.Snapshot] = *info } - if si := initializer.GetPrebuild(); si != nil && si.Prebuild != nil && si.Prebuild.Snapshot != "" { - bkt, obj, err := storage.ParseSnapshotName(si.Prebuild.Snapshot) + if pi != nil && pi.Prebuild != nil && pi.Prebuild.Snapshot != "" { + bkt, obj, err := storage.ParseSnapshotName(pi.Prebuild.Snapshot) if err != nil { return nil, err } @@ -103,7 +115,7 @@ func collectRemoteContent(ctx context.Context, rs storage.DirectAccess, ps stora } else if err != nil { return nil, xerrors.Errorf("cannot find prebuild: %w", err) } else { - rc[si.Prebuild.Snapshot] = *info + rc[pi.Prebuild.Snapshot] = *info } }