Skip to content

Commit

Permalink
✨ Make sure to support Namespaces (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Templum authored Feb 18, 2021
1 parent 5c8053a commit f2b6600
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/openfaas/cacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package openfaas

import (
"context"
types2 "github.com/Templum/rabbitmq-connector/pkg/types"
"fmt"
"log"
"strings"
"time"

types2 "github.com/Templum/rabbitmq-connector/pkg/types"

"github.com/Templum/rabbitmq-connector/pkg/config"
"github.com/openfaas/faas-provider/types"
)
Expand Down Expand Up @@ -102,7 +104,11 @@ func (c *Controller) crawlFunctions(ctx context.Context, namespaces []string, bu
topics := c.extractTopicsFromAnnotations(fn)

for _, topic := range topics {
builder.Append(topic, fn.Name)
if len(ns) > 0 {
builder.Append(topic, fmt.Sprintf("%s.%s", fn.Name, ns)) // Include Namespace to call the correct function
} else {
builder.Append(topic, fn.Name)
}
}
}
}
Expand Down

0 comments on commit f2b6600

Please sign in to comment.