From f8c1e14a136c9702f459a36a1ea2e75fedd123af Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Mon, 6 Feb 2023 11:07:09 +0100 Subject: Use import of OCI structs (#22765) Fixes #22758 Otherwise we would need to rewrite the structs in `oci.go`. --- services/packages/container/cleanup.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services/packages') diff --git a/services/packages/container/cleanup.go b/services/packages/container/cleanup.go index d6d4d152c8..1a9ef26391 100644 --- a/services/packages/container/cleanup.go +++ b/services/packages/container/cleanup.go @@ -10,8 +10,9 @@ import ( packages_model "code.gitea.io/gitea/models/packages" container_model "code.gitea.io/gitea/models/packages/container" container_module "code.gitea.io/gitea/modules/packages/container" - "code.gitea.io/gitea/modules/packages/container/oci" "code.gitea.io/gitea/modules/util" + + digest "github.com/opencontainers/go-digest" ) // Cleanup removes expired container data @@ -87,7 +88,7 @@ func ShouldBeSkipped(ctx context.Context, pcr *packages_model.PackageCleanupRule } // Check if the version is a digest (or untagged) - if oci.Digest(pv.LowerVersion).Validate() { + if digest.Digest(pv.LowerVersion).Validate() == nil { // Check if there is another manifest referencing this version has, err := packages_model.ExistVersion(ctx, &packages_model.PackageSearchOptions{ PackageID: p.ID, -- cgit v1.2.3