cloudnative-pg / cloudnative-pg/cloudnative-pg

[Bug]: imageName and imageCatalogRef are mutually exclusive

Open
#8,166 7 comments 2 reactions 1 assignee Claimed by @gbartolini View on GitHub
documentation :book:
Dominant language
Go
Stars
9.3k
Forks
759
Avg merge
2d 6h
Merged PRs (30d)
44

Description

### Is there an existing issue already for this bug?

- [x] I have searched for an existing issue, and could not find anything. I believe this is a new bug.

### I have read the troubleshooting guide

- [x] I have read the troubleshooting guide and I think this is a new bug.

### I am running a supported version of CloudNativePG

- [x] I have read the troubleshooting guide and I think this is a new bug.

### Contact Details

_No response_

### Version

1.26 (latest patch)

### What version of Kubernetes are you using?

1.32

### What is your Kubernetes environment?

Self-managed: kind (evaluation)

### How did you install the operator?

YAML manifest

### What happened?

I tried to add the following lines to my cluster definition:

```
imageCatalogRef:
apiGroup: postgresql.cnpg.io
kind: ClusterImageCatalog
name: postgresql
major: 17
```

If I apply this to my cluster I get the following error:

The Cluster "cl01" is invalid: spec: Invalid value: "object": imageName and imageCatalogRef are mutually exclusive

If I edit the cluster resource manually and remove the imageName field and replace it with the imageCatalogRef-part from above it gets edited

### Cluster resource

```shell
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cl01
namespace: default
spec:
instances: 1
imageCatalogRef:
apiGroup: postgresql.cnpg.io
kind: ClusterImageCatalog
name: postgresql
major: 17
env:
- name: TZ
value: Europe/Berlin
postgresql:
parameters:
password_encryption: scram-sha-256
# WAL-Level für Archivierung
wal_level: replica
# WAL-Dateien behalten bis Archivierung
archive_timeout: '300s' # Erzwingt WAL-Switch alle 5min
# Mehr WAL-Dateien für bessere Performance
max_wal_size: '1GB'
min_wal_size: '80MB'
pg_hba:
- hostssl all all 0.0.0.0/0 scram-sha-256
storage:
size: 10Gi
storageClass: "ceph-rbd" # Anpassen an verfügbare StorageClass
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
# Disabled to reduce attack surface
enableSuperuserAccess: false
superuserSecret:
name: cnpg-postgres-superuser
plugins:
- name: barman-cloud.cloudnative-pg.io
enabled: true
isWALArchiver: true
parameters:
barmanObjectName: minio
# Monitoring aktivieren
monitoring:
enablePodMonitor: true
```

### Relevant log output

```shell
The Cluster "cl01" is invalid: spec: Invalid value: "object": imageName and imageCatalogRef are mutually exclusive
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.