Skip to content

Commit

Permalink
feat: add namespace scoped option
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic committed Jan 13, 2025
1 parent 735c5e8 commit 6bc3cc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/manager/controller_manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ webhook:
leaderElection:
leaderElect: true
resourceName: 16e1bc09.strange.love
namespaceSelector:
regex: "*" # Selects all namespaces by default
# leaderElectionReleaseOnCancel defines if the leader should step down volume
# when the Manager ends. This requires the binary to immediately end when the
# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ var (
profileMode string
logLevel string
logFormat string
namespaceRegex string
)

func rootCmd() *cobra.Command {
Expand All @@ -101,6 +102,7 @@ func rootCmd() *cobra.Command {
root.Flags().StringVar(&profileMode, "profile", "", "Enable profiling and save profile to working dir. (Must be one of 'cpu', or 'mem'.)")
root.Flags().StringVar(&logLevel, "log-level", "info", "Logging level one of 'error', 'info', 'debug'")
root.Flags().StringVar(&logFormat, "log-format", "console", "Logging format one of 'console' or 'json'")
root.Flags().StringVar(&namespaceRegex, "namespace", "*", "Regex pattern for namespaces to watch")

if err := viper.BindPFlags(root.Flags()); err != nil {
panic(err)
Expand Down

0 comments on commit 6bc3cc5

Please sign in to comment.