Skip to content

Commit

Permalink
fix assignment to entry in nil map when --watch-namespaces flag is pr…
Browse files Browse the repository at this point in the history
…ovided

Signed-off-by: alexandre.vilain <[email protected]>
  • Loading branch information
alexandrevilain committed Sep 4, 2024
1 parent eb81068 commit 606f062
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/fluent-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ limitations under the License.
package main

import (
"errors"
"flag"
"os"
"strings"

"errors"

"github.com/joho/godotenv"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
Expand Down Expand Up @@ -105,6 +104,8 @@ func main() {
config := cache.Config{}
namespacedController = true
namespaces := strings.Split(watchNamespaces, ",")

ctrlOpts.Cache.DefaultNamespaces = make(map[string]cache.Config)
for _, namespace := range namespaces {
ctrlOpts.Cache.DefaultNamespaces[namespace] = config
}
Expand Down

0 comments on commit 606f062

Please sign in to comment.