fix operatorconfigurations CRD: render sidecars as array (#3160)

configuration.sidecars was annotated with kubebuilder:validation:Type=object
while SidecarContainers is a []v1.Container, so the generated schema rejected
every list value and global sidecars could not be configured at all.

Drop the hand-written Schemaless/Type=object markers and let controller-gen
derive the schema from the Go type, the same way spec.initContainers is
already handled in the Postgresql CRD. The field now renders as type: array
with a full Container schema for its items.

Fixes #3159

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
rasoanaivo-r 2026-08-11 17:10:05 +02:00 committed by GitHub
parent bd8e361f65
commit b43c7be1d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4564 additions and 9 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -430,9 +430,7 @@ type OperatorConfigurationData struct {
// +kubebuilder:default=true // +kubebuilder:default=true
ShmVolume *bool `json:"enable_shm_volume,omitempty"` ShmVolume *bool `json:"enable_shm_volume,omitempty"`
SidecarImages map[string]string `json:"sidecar_docker_images,omitempty"` // deprecated in favour of SidecarContainers SidecarImages map[string]string `json:"sidecar_docker_images,omitempty"` // deprecated in favour of SidecarContainers
// +kubebuilder:validation:XPreserveUnknownFields // +nullable
// +kubebuilder:validation:Type=object
// +kubebuilder:validation:Schemaless
SidecarContainers []v1.Container `json:"sidecars,omitempty"` SidecarContainers []v1.Container `json:"sidecars,omitempty"`
// +optional // +optional
PostgresUsersConfiguration PostgresUsersConfiguration `json:"users"` PostgresUsersConfiguration PostgresUsersConfiguration `json:"users"`

File diff suppressed because it is too large Load Diff