Skip to content

Commit bc33969

Browse files
StarefossenCopilot
andcommitted
fix: correct E2E assertions and use enforced disk size for WAL tuning
- Fix PodMonitor/PrometheusRule E2E assertions: CNPG uses the CR's own namespace (not pg-<team>) and names are prefixed with pg- - Use enforceMinimum2GiDisk() for WAL sizing to align with actual PVC size Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a8edef3 commit bc33969

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/controller/resourcecreator/cnpg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func MinimalCNPGPooler(postgres *data_nais_io_v1.Postgres, clusterName, namespac
238238

239239
func makeCNPGPostgresParameters(cluster data_nais_io_v1.PostgresCluster) map[string]string {
240240
memBytes := cluster.Resources.Memory.Value()
241-
diskBytes := cluster.Resources.DiskSize.Value()
241+
diskBytes := enforceMinimum2GiDisk(cluster.Resources.DiskSize).Value()
242242

243243
// PostgreSQL memory tuning parameters based on available memory
244244
sharedBuffers := memBytes / sharedBuffersFraction

tests/e2e/postgres-cnpg-basic/chainsaw-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ spec:
8383
apiVersion: monitoring.coreos.com/v1
8484
kind: PodMonitor
8585
metadata:
86-
name: mydb
87-
namespace: pg-cnpg-team
86+
name: pg-mydb
87+
namespace: cnpg-team
8888
labels:
8989
prometheus: tenant
9090
spec:
@@ -100,8 +100,8 @@ spec:
100100
apiVersion: monitoring.coreos.com/v1
101101
kind: PrometheusRule
102102
metadata:
103-
name: mydb
104-
namespace: pg-cnpg-team
103+
name: pg-mydb
104+
namespace: cnpg-team
105105
- name: Assert engine annotation set
106106
try:
107107
- assert:

0 commit comments

Comments
 (0)