Skip to content

Commit

Permalink
Smooth syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Wessendorf <[email protected]>
  • Loading branch information
matzew committed Jan 11, 2024
1 parent cc0121f commit 8a4e662
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ func runSubscribe(cmd *cobra.Command, args []string) (err error) {
// add subscription to function
f.Deploy.Subscriptions = append(f.Deploy.Subscriptions, fn.KnativeSubscription{
Source: cfg.Source,
Filters: extractFilterMap(cfg),
Filters: extractFilterMap(cfg.Filter),
})

// pump it
return f.Write()

}

func extractFilterMap(cfg subscibeConfig) map[string]string {
func extractFilterMap(filters []string) map[string]string {
subscriptionFilters := make(map[string]string)
for _, filter := range cfg.Filter {
for _, filter := range filters {
kv := strings.Split(filter, "=")
if len(kv) != 2 {
fmt.Println("Invalid pair:", filter)
Expand Down

0 comments on commit 8a4e662

Please sign in to comment.