Skip to content
Permalink
Browse files
fix: panic when --cache-repo used
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed May 16, 2022
1 parent c59f1f9 commit ec2ed932d128086bc3f61198486c3f379f1948fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
@@ -57,6 +57,7 @@ func (i *legacyBaseImage) UnsetInfo() {

func (i *legacyBaseImage) SetStageDescription(stageDesc *image.StageDescription) {
i.stageDesc = stageDesc
i.SetInfo(stageDesc.Info)
}

func (i *legacyBaseImage) GetStageDescription() *image.StageDescription {
@@ -466,6 +466,15 @@ func (m *StorageManager) FetchStage(ctx context.Context, containerBackend contai
}
} else {
logboek.Context(ctx).Info().LogF("Cache repo image %s exists locally, will not perform fetch\n", stageImage.Name())

stageDesc, err := getStageDescription(ctx, m.ProjectName, *stageID, stagesStorage, nil, getStageDescriptionOptions{WithLocalManifestCache: true})
if err != nil {
return nil, fmt.Errorf("error getting stage %s description from %s: %w", stageID.String(), m.FinalStagesStorage.String(), err)
}
if stageDesc == nil {
return nil, ErrStageNotFound
}
stageImage.SetStageDescription(stageDesc)
}

if err := lrumeta.CommonLRUImagesCache.AccessImage(ctx, stageImage.Name()); err != nil {

0 comments on commit ec2ed93

Please sign in to comment.