Skip to content

Commit

Permalink
fix(oci): Don't delete dependencies of index
Browse files Browse the repository at this point in the history
When we package an application it can be the case that we have
a dependency on another package (e.g. a kernel). In these cases,
the dependency is not actually packed together with our application,
instead we just keep a reference to it. The problem arises when we
attempt to overwrite such a package. Because all dependencies
were previously deleted, this meant that both of the underlying packages
would be removed, but only the application would get repackaged, resulting
in an app that cannot be run due to missing layers.

Setting this flag to false and not removing dependencies solves this issue,
but causes the cache to grow indefinitely, which is less than ideal.

Signed-off-by: Luca Seritan <[email protected]>
  • Loading branch information
LucaSeri committed May 9, 2024
1 parent b46a3f6 commit 0660e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oci/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func NewPackageFromTarget(ctx context.Context, targ target.Target, opts ...packm
}

case packmanager.StrategyOverwrite:
if err := ocipack.handle.DeleteIndex(ctx, ocipack.ref.Name(), true); err != nil {
if err := ocipack.handle.DeleteIndex(ctx, ocipack.ref.Name(), false); err != nil {
return nil, fmt.Errorf("could not remove existing index: %w", err)
}

Expand Down

0 comments on commit 0660e09

Please sign in to comment.