mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-19 16:55:16 +01:00
enhance the label selector
Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
parent
6479a22a08
commit
640fcdaee3
@ -51,7 +51,10 @@ func (s *selector) Select(artifacts []*res.Candidate) (selected []*res.Candidate
|
||||
|
||||
// New is factory method for list selector
|
||||
func New(decoration string, pattern string) res.Selector {
|
||||
labels := strings.Split(pattern, ",")
|
||||
labels := make([]string, 0)
|
||||
if len(pattern) > 0 {
|
||||
labels = append(labels, strings.Split(pattern, ",")...)
|
||||
}
|
||||
|
||||
return &selector{
|
||||
decoration: decoration,
|
||||
|
Loading…
Reference in New Issue
Block a user