Skip to content

Commit a9f85de

Browse files
committed
Bump lowest tested K8s, adjust CEL
5.8+ has k8s 1.30 for its floor; OCP is 4.14 (k8s 1.27) but 4.16 (k8s 1.29) works with this CEL.
1 parent fe54a36 commit a9f85de

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
strategy:
5959
fail-fast: false
6060
matrix:
61-
kubernetes: [v1.33, v1.28]
61+
kubernetes: [v1.33, v1.30]
6262
steps:
6363
- uses: actions/checkout@v5
6464
- uses: actions/setup-go@v5
@@ -92,7 +92,7 @@ jobs:
9292
strategy:
9393
fail-fast: false
9494
matrix:
95-
kubernetes: [v1.33, v1.28]
95+
kubernetes: [v1.33, v1.30]
9696
steps:
9797
- uses: actions/checkout@v5
9898
- uses: actions/setup-go@v5

config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16508,12 +16508,11 @@ spec:
1650816508
type: object
1650916509
type: object
1651016510
x-kubernetes-validations:
16511-
- message: logfile destination is restricted to '/tmp/logs/pgbouncer/'
16512-
or an existing additional volume
16513-
rule: '!has(self.config) || !has(self.config.global) || !has(self.config.global.logfile)
16514-
|| self.config.global.logfile.startsWith(''/tmp/logs/pgbouncer/'')
16515-
|| (has(self.volumes) && has(self.volumes.additional) && self.volumes.additional.exists(x,
16516-
self.config.global.logfile.startsWith("/volumes/"+x.name)))'
16511+
- message: config.global.logfile destination is restricted to
16512+
'/tmp/logs/pgbouncer/' or an existing additional volume
16513+
rule: self.?config.global.logfile.optMap(f, f.startsWith("/tmp/logs/pgbouncer/")
16514+
|| (self.?volumes.additional.hasValue() && self.volumes.additional.exists(v,
16515+
f.startsWith("/volumes/" + v.name)))).orValue(true)
1651716516
required:
1651816517
- pgBouncer
1651916518
type: object

pkg/apis/postgres-operator.crunchydata.com/v1/pgbouncer_types.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import (
99
)
1010

1111
// PGBouncerPodSpec defines the desired state of a PgBouncer connection pooler.
12-
// +kubebuilder:validation:XValidation:rule=`!has(self.config) || !has(self.config.global) || !has(self.config.global.logfile) || self.config.global.logfile.startsWith('/tmp/logs/pgbouncer/') || (has(self.volumes) && has(self.volumes.additional) && self.volumes.additional.exists(x, self.config.global.logfile.startsWith("/volumes/"+x.name)))`,message=`logfile destination is restricted to '/tmp/logs/pgbouncer/' or an existing additional volume`
13-
// ---
14-
// TODO: the `.?` CEL syntax is unsupported in k8s 1.28, so we cannot use the optional field syntax
15-
// of `self.?config.global.logfile` and `self.?volumes.additional`
12+
// +kubebuilder:validation:XValidation:rule=`self.?config.global.logfile.optMap(f, f.startsWith("/tmp/logs/pgbouncer/") || (self.?volumes.additional.hasValue() && self.volumes.additional.exists(v, f.startsWith("/volumes/" + v.name)))).orValue(true)`,message=`config.global.logfile destination is restricted to '/tmp/logs/pgbouncer/' or an existing additional volume`
1613
type PGBouncerPodSpec struct {
1714
v1beta1.PGBouncerPodSpec `json:",inline"`
1815
}

0 commit comments

Comments
 (0)