mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-09-06 06:52:21 +02:00
Compare commits
4 Commits
f1d3b48bdd
...
971958a8e8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
971958a8e8 | ||
|
|
9967e2caab | ||
|
|
042eb6c579 | ||
|
|
5d514f481f |
12
CODEOWNERS
12
CODEOWNERS
@ -1,5 +1,9 @@
|
||||
# The CODEOWNERS file is used to define individuals or teams that are
|
||||
# responsible for code in a repository. For details, please refer to
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners
|
||||
# This file is generated from componentowners-policy.yaml in
|
||||
# cloudnative-pg/cnpg-infra — do not hand-edit, propose changes there instead.
|
||||
#
|
||||
# Path-scoped rules below always include the repo's own general owners
|
||||
# (the "*" line) in addition to their own specific teams/users, since
|
||||
# CODEOWNERS only honors the LAST matching pattern for a given path —
|
||||
# it does not merge an earlier, less-specific rule into a later one.
|
||||
|
||||
* @leonardoce @mnencia @gbartolini @fcanovai @armru @NiccoloFei
|
||||
* @cloudnative-pg/plugin-barman-cloud-owners
|
||||
|
||||
@ -103,5 +103,12 @@ func NewCmd() *cobra.Command {
|
||||
|
||||
_ = viper.BindEnv("sidecar-image", "SIDECAR_IMAGE")
|
||||
|
||||
cmd.Flags().String(
|
||||
"watch-namespace",
|
||||
"",
|
||||
"The namespace to watch for CloudNativePG clusters. If empty, all namespaces will be watched.",
|
||||
)
|
||||
_ = viper.BindPFlag("watch-namespace", cmd.Flags().Lookup("watch-namespace"))
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ import (
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/cache"
|
||||
"sigs.k8s.io/controller-runtime/pkg/healthz"
|
||||
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"
|
||||
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
|
||||
@ -100,6 +101,14 @@ func Start(ctx context.Context) error {
|
||||
metricsServerOptions.FilterProvider = filters.WithAuthenticationAndAuthorization
|
||||
}
|
||||
|
||||
var cacheOptions cache.Options
|
||||
if viper.GetString("watch-namespace") != "" {
|
||||
setupLog.Info("Watching a single namespace", "namespace", viper.GetString("watch-namespace"))
|
||||
cacheOptions = cache.Options{
|
||||
DefaultNamespaces: map[string]cache.Config{viper.GetString("watch-namespace"): {}},
|
||||
}
|
||||
}
|
||||
|
||||
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
|
||||
Scheme: scheme,
|
||||
Metrics: metricsServerOptions,
|
||||
@ -118,6 +127,7 @@ func Start(ctx context.Context) error {
|
||||
// if you are doing or is intended to do any operation such as perform cleanups
|
||||
// after the manager stops then its usage might be unsafe.
|
||||
LeaderElectionReleaseOnCancel: true,
|
||||
Cache: cacheOptions,
|
||||
})
|
||||
if err != nil {
|
||||
setupLog.Error(err, "unable to start manager")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user