Skip to content

Commit

Permalink
💄 make array when filters is nil (#959)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Wessendorf <[email protected]>
  • Loading branch information
matzew authored Nov 12, 2024
1 parent 02eee15 commit 71fa2f6
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 71fa2f6

Please sign in to comment.