diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2023-02-06 11:07:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-06 10:07:09 +0000 |
commit | f8c1e14a136c9702f459a36a1ea2e75fedd123af (patch) | |
tree | a401f816808457c9851ca98094dc24a5fdc1d985 /services | |
parent | 361d8072747ae930695337b6217cb1b1773268ea (diff) | |
download | gitea-f8c1e14a136c9702f459a36a1ea2e75fedd123af.tar.gz gitea-f8c1e14a136c9702f459a36a1ea2e75fedd123af.zip |
Use import of OCI structs (#22765)
Fixes #22758
Otherwise we would need to rewrite the structs in `oci.go`.
Diffstat (limited to 'services')
-rw-r--r-- | services/packages/container/cleanup.go | 5 |
1 files changed, 3 insertions, 2 deletions
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, |