Skip to content

Commit

Permalink
Print out total functions and detect internal NATS
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Mar 14, 2023
1 parent 09f8a58 commit b4b89aa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,13 @@ func main() {
}
}
}

if dep.Name == "nats" {
for _, container := range dep.Spec.Template.Spec.Containers {
if container.Name == "nats" {
internalNats = true
if dep.Labels["app"] == "openfaas" {
internalNats = true
}
}
}
}
Expand Down Expand Up @@ -503,8 +506,15 @@ Features detected:

fmt.Printf("\n")

totalFunctions := 0
for _, namespace := range functionNamespaces {
totalFunctions += len(nsFunctions[namespace])
}

fmt.Printf("Total functions in cluster: %d\n\n", totalFunctions)

for _, namespace := range functionNamespaces {
fmt.Printf("\nFunctions in (%s):\n\n", namespace)
fmt.Printf("\n%d functions in (%s):\n\n", len(nsFunctions[namespace]), namespace)
functions, ok := nsFunctions[namespace]
if ok {
if len(functions) == 0 {
Expand Down

0 comments on commit b4b89aa

Please sign in to comment.