Skip to content

Commit

Permalink
Force compute
Browse files Browse the repository at this point in the history
Signed-off-by: Natalie Arellano <narellano@vmware.com>
  • Loading branch information
natalieparellano committed Feb 2, 2024
1 parent 9cef4d4 commit 244aa16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions new.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ func EnsureMediaTypesAndLayers(image v1.Image, requestedTypes MediaTypes, mutate
return nil, false, fmt.Errorf("failed to append layers: %w", err)
}

// (5) force compute
afterLayers, err := retImage.Layers()
if err != nil {
return nil, false, fmt.Errorf("failed to get layers: %w", err)
}
if len(afterLayers) != len(beforeLayers) {
return nil, false, fmt.Errorf("expected %d layers; got %d", len(beforeLayers), len(afterLayers))
}

return retImage, true, nil
}

Expand Down

0 comments on commit 244aa16

Please sign in to comment.