Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`isWALArchiever` is ignored when multiple Barman Cloud plugins defined

Aperta
#934 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go, kubernetes, postgresql
Ambito
backend, databases

Direzione di ricerca

Inizia da internal/cnpgi/operator/config/config.go, in particolare da NewPlugin e NewFromCluster, e riproduci la configurazione con nomi duplicati descritta nell’issue. Confronta questa risoluzione con i riferimenti alla validazione CNPG e alla selezione dell’archiviatore WAL. Il lavoro è completo quando il comportamento delle voci duplicate è gestito esplicitamente e coperto da un test appropriato oppure documentato come intenzionale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Summary

When defining multiple entries with the same plugin name (barman-cloud.cloudnative-pg.io) in Cluster.spec.plugins, WAL archiving appears to use the parameters of the last matching entry.

In practice, isWALArchiver can look ignored because WALs are pushed using barmanObjectName from the last plugin entry.

Environment

  • CloudNativePG: 1.29.1
  • plugin-barman-cloud: 0.12.0
  • Kubernetes: Kind (local)

Minimal reproduction

Create two object stores:

  • store-a (intended WAL target)
  • store-b (intended backup-only target)

Then use a Cluster with duplicate plugin entries:

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: pg
spec:
  instances: 1
  imageName: ghcr.io/cloudnative-pg/postgresql:16
  storage:
    size: 1Gi
  plugins:
    - name: barman-cloud.cloudnative-pg.io
      isWALArchiver: true
      parameters:
        barmanObjectName: store-a
    - name: barman-cloud.cloudnative-pg.io
      parameters:
        barmanObjectName: store-b

Generate write traffic and inspect object stores.

Expected behavior

WALs should go to store-a because that entry has isWALArchiver: true.

Actual behavior

WALs are pushed to store-b (the last plugin entry in spec.plugins).

Why this seems to happen

From source review:

  1. CNPG validates "at most one WAL archiver" but does not reject duplicate plugin names.
  2. CNPG selects WAL archiver by plugin name.
  3. plugin-barman-cloud config extraction overwrites parameters on each matching plugin name while iterating, so the last matching entry wins.

Relevant source references

  • CNPG webhook validation (at most one WAL archiver):
    • internal/webhook/v1/cluster_webhook.go (validatePluginConfiguration) [1]
  • CNPG WAL archiver plugin name selection:
    • api/v1/cluster_funcs.go (GetEnabledWALArchivePluginName) [2]
  • plugin-barman-cloud parameter resolution (last match wins):
    • internal/cnpgi/operator/config/config.go (NewPlugin, NewFromCluster) [3]

Conclusion / Questions for maintainers

Could you please confirm whether this is the intended behavior when multiple
spec.plugins entries share the same plugin name?

If this behavior is intentional:

  • Is it documented somewhere (especially the effective "last matching entry wins"
    parameter resolution)?

If this behavior is not intentional:

  • Are there plans to fix it (for example by rejecting duplicate plugin names in
    validation or by making plugin resolution deterministic and explicit)?

Thanks for your time and for maintaining these projects.

[1] https://github.com/cloudnative-pg/cloudnative-pg/blob/758532a6f4bc148f7f73a769e3abbfe3ffbc710c/internal/webhook/v1/cluster_webhook.go#L2788
[2] https://github.com/cloudnative-pg/cloudnative-pg/blob/758532a6f4bc148f7f73a769e3abbfe3ffbc710c/api/v1/cluster_funcs.go#L1547
[3] https://github.com/cloudnative-pg/plugin-barman-cloud/blob/0bb78879ce8202addf1f0d3bbfbf4485f81a1290/internal/cnpgi/operator/config/config.go#L282

Lingua principale
Go
Stelle
198
Fork
81
Merge medio
2g 6h
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudnative-pg/plugin-barman-cloud

Tutte le issue di cloudnative-pg/plugin-barman-cloud

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.