💄 make array when filters is nil (#2569)

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
This commit is contained in:
Matthias Wessendorf 2024-11-05 15:05:39 +01:00 committed by GitHub
parent 2b83bac27f
commit ff6053a92d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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