diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2023-01-16 23:35:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 17:35:48 -0500 |
commit | 3510d7e33ace5302691b6e96b9bde71148ed6e4c (patch) | |
tree | 4a1b765d478092900237b00a1bcfea0818a3e89e /models | |
parent | 1aba53db62275e45209210a5bf6d830dfc2010d3 (diff) | |
download | gitea-3510d7e33ace5302691b6e96b9bde71148ed6e4c.tar.gz gitea-3510d7e33ace5302691b6e96b9bde71148ed6e4c.zip |
Fix container blob mount (#22226)
Diffstat (limited to 'models')
-rw-r--r-- | models/packages/container/search.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/models/packages/container/search.go b/models/packages/container/search.go index 2e35c44766..b65c8634d6 100644 --- a/models/packages/container/search.go +++ b/models/packages/container/search.go @@ -25,6 +25,7 @@ type BlobSearchOptions struct { Digest string Tag string IsManifest bool + Repository string } func (opts *BlobSearchOptions) toConds() builder.Cond { @@ -53,6 +54,15 @@ func (opts *BlobSearchOptions) toConds() builder.Cond { cond = cond.And(builder.In("package_file.id", builder.Select("package_property.ref_id").Where(propsCond).From("package_property"))) } + if opts.Repository != "" { + var propsCond builder.Cond = builder.Eq{ + "package_property.ref_type": packages.PropertyTypePackage, + "package_property.name": container_module.PropertyRepository, + "package_property.value": opts.Repository, + } + + cond = cond.And(builder.In("package.id", builder.Select("package_property.ref_id").Where(propsCond).From("package_property"))) + } return cond } |