mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 20:59:10 +01:00
Merge pull request #11348 from ywk253100/200330_tag_filter
Make sure the tag filter have the same behavior for empty value and *
This commit is contained in:
commit
6815e8dc4d
@ -155,6 +155,19 @@ func (a *artifactTagFilter) Filter(artifacts []*model.Artifact) ([]*model.Artifa
|
||||
}
|
||||
var result []*model.Artifact
|
||||
for _, artifact := range artifacts {
|
||||
// untagged artifact
|
||||
if len(artifact.Tags) == 0 {
|
||||
match, err := util.Match(a.pattern, "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if match {
|
||||
result = append(result, artifact)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// tagged artifact
|
||||
var tags []string
|
||||
for _, tag := range artifact.Tags {
|
||||
match, err := util.Match(a.pattern, tag)
|
||||
|
Loading…
Reference in New Issue
Block a user