Skip to content

Commit

Permalink
lipstick: make array when filters is nil (#2570)
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 858a0e8 commit 622c4ae
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 622c4ae

Please sign in to comment.