Skip to content

Commit da04400

Browse files
authored
Update labels for k8s v1.34 (#395)
Signed-off-by: Peter Jiang <[email protected]>
1 parent c449507 commit da04400

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/api/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
log "github.com/sirupsen/logrus"
1313
yaml3 "gopkg.in/yaml.v3"
1414
corev1 "k8s.io/api/core/v1"
15-
"k8s.io/apimachinery/pkg/fields"
15+
"k8s.io/apimachinery/pkg/labels"
1616
"sigs.k8s.io/yaml"
1717
)
1818

@@ -34,15 +34,15 @@ type Config struct {
3434
}
3535

3636
// Returns list of destinations for the specified trigger
37-
func (cfg Config) GetGlobalDestinations(labels map[string]string) services.Destinations {
37+
func (cfg Config) GetGlobalDestinations(resourceLabels map[string]string) services.Destinations {
3838
dests := services.Destinations{}
3939
for _, s := range cfg.Subscriptions {
4040
triggers := s.Triggers
4141
if len(triggers) == 0 {
4242
triggers = cfg.DefaultTriggers
4343
}
4444
for _, trigger := range triggers {
45-
if s.MatchesTrigger(trigger) && s.Selector.Matches(fields.Set(labels)) {
45+
if s.MatchesTrigger(trigger) && s.Selector.Matches(labels.Set(resourceLabels)) {
4646
for _, recipient := range s.Recipients {
4747
parts := strings.Split(recipient, ":")
4848
dest := services.Destination{Service: parts[0]}

0 commit comments

Comments
 (0)