mirror of
https://github.com/goharbor/harbor.git
synced 2024-08-26 05:53:11 +02: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
|
// New is factory method for list selector
|
||||||
func New(decoration string, pattern string) res.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{
|
return &selector{
|
||||||
decoration: decoration,
|
decoration: decoration,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user