feat: forbid usage of .spec.configuration.serverName in ObjectStore (#336)

Closes #334

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This commit is contained in:
Marco Nenciarini 2025-05-09 11:29:38 +02:00 committed by GitHub
parent c59043a934
commit 3420f43073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -38,6 +38,7 @@ type InstanceSidecarConfiguration struct {
// ObjectStoreSpec defines the desired state of ObjectStore. // ObjectStoreSpec defines the desired state of ObjectStore.
type ObjectStoreSpec struct { type ObjectStoreSpec struct {
// The configuration for the barman-cloud tool suite // The configuration for the barman-cloud tool suite
// +kubebuilder:validation:XValidation:rule="!has(self.serverName)",fieldPath=".serverName",reason="FieldValueForbidden",message="use the 'serverName' plugin parameter in the Cluster resource"
Configuration barmanapi.BarmanObjectStoreConfiguration `json:"configuration"` Configuration barmanapi.BarmanObjectStoreConfiguration `json:"configuration"`
// RetentionPolicy is the retention policy to be used for backups // RetentionPolicy is the retention policy to be used for backups

View File

@ -382,6 +382,11 @@ spec:
required: required:
- destinationPath - destinationPath
type: object type: object
x-kubernetes-validations:
- fieldPath: .serverName
message: use the 'serverName' plugin parameter in the Cluster resource
reason: FieldValueForbidden
rule: '!has(self.serverName)'
instanceSidecarConfiguration: instanceSidecarConfiguration:
description: The configuration for the sidecar that runs in the instance description: The configuration for the sidecar that runs in the instance
pods pods

View File

@ -381,6 +381,11 @@ spec:
required: required:
- destinationPath - destinationPath
type: object type: object
x-kubernetes-validations:
- fieldPath: .serverName
message: use the 'serverName' plugin parameter in the Cluster resource
reason: FieldValueForbidden
rule: '!has(self.serverName)'
instanceSidecarConfiguration: instanceSidecarConfiguration:
description: The configuration for the sidecar that runs in the instance description: The configuration for the sidecar that runs in the instance
pods pods