Compare commits

...

5 Commits

Author SHA1 Message Date
Augusto Ribeiro
97d9d84593
Merge 042eb6c579 into a95197e648 2026-08-31 10:59:25 +08:00
dblugeon
a95197e648
docs(web): fix retention policy path in concepts documentation (#1059)
Corrected path for retention policy in documentation.

Closes #1061

Signed-off-by: dblugeon <dblugeon@users.noreply.github.com>
2026-08-28 12:29:47 +02:00
renovate[bot]
ad5311efa5
chore(deps): update golangci/golangci-lint docker tag to v2.13.2 (#1088)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-28 10:29:19 +02:00
Augusto Ribeiro
042eb6c579
Merge branch 'cloudnative-pg:main' into watchworkspace 2026-02-02 14:58:54 +01:00
augusto.ribeiro
5d514f481f adding a watch-namespace option in order to only watch one namespace if set
Signed-off-by: augusto.ribeiro <augusto.ribeiro@cloudkitchens.com>
Signed-off-by: augustoribeiro <augusto.mcc@gmail.com>
2026-02-02 14:57:43 +01:00
4 changed files with 19 additions and 2 deletions

View File

@ -23,7 +23,7 @@ tasks:
# renovate: datasource=git-refs depName=golangci-lint lookupName=https://github.com/sagikazarmark/daggerverse currentValue=main
DAGGER_GOLANGCI_LINT_SHA: ff27cd50f6b4eed2e3753c520632cd6099e1ce52
# renovate: datasource=docker depName=golangci/golangci-lint versioning=semver
GOLANGCI_LINT_VERSION: v2.13.1
GOLANGCI_LINT_VERSION: v2.13.2
cmds:
- >
GITHUB_REF= dagger -sc "github.com/sagikazarmark/daggerverse/golangci-lint@${DAGGER_GOLANGCI_LINT_SHA}

View File

@ -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
}

View File

@ -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")

View File

@ -35,7 +35,7 @@ object storage system. It allows you to configure:
- **Base backup options**—with similar settings for compression, concurrency,
and encryption—under `.spec.configuration.data`
- **Retention policies** to manage the life-cycle of archived WALs and backups
via `.spec.configuration.retentionPolicy`
via `.spec.retentionPolicy`
WAL files are archived in the `wals` directory, while base backups are stored
as **tarballs** in the `base` directory, following the