Skip to content

Commit

Permalink
lipstick: make array when filters is nil (#2571)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
  • Loading branch information
knative-prow-robot and matzew authored Nov 5, 2024
1 parent 462cdc2 commit 76b7032
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func updateOrAddSubscription(subscriptions []fn.KnativeSubscription, cfg subscib
for i, subscription := range subscriptions {
if subscription.Source == cfg.Source {
found = true

if subscription.Filters == nil {
subscription.Filters = make(map[string]string)
}

// Update filters. Override if the key already exists.
for newKey, newValue := range newFilters {
subscription.Filters[newKey] = newValue
Expand Down

0 comments on commit 76b7032

Please sign in to comment.