Skip to content

Commit b7a23a9

Browse files
authored
Merge pull request #6 from CrunchyData/main
sync with upstream
2 parents 4c4ec0c + 740400d commit b7a23a9

File tree

5 files changed

+54
-48
lines changed

5 files changed

+54
-48
lines changed

.github/workflows/test.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ jobs:
6767
with:
6868
k3s-channel: "${{ matrix.kubernetes }}"
6969
prefetch-images: |
70-
registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.0-0
71-
registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-2
72-
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-1
70+
registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.1-0
71+
registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-3
72+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-2
7373
7474
- run: make createnamespaces check-envtest-existing
7575
env:
@@ -90,7 +90,7 @@ jobs:
9090
strategy:
9191
fail-fast: false
9292
matrix:
93-
kubernetes: [v1.31, v1.30, v1.29, v1.28]
93+
kubernetes: [v1.32, v1.31, v1.30, v1.29, v1.28]
9494
steps:
9595
- uses: actions/checkout@v4
9696
- uses: actions/setup-go@v5
@@ -101,16 +101,16 @@ jobs:
101101
with:
102102
k3s-channel: "${{ matrix.kubernetes }}"
103103
prefetch-images: |
104-
registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-33
105-
registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.0-0
106-
registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-2
104+
registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-34
105+
registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.1-0
106+
registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-3
107107
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:latest
108108
registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:latest
109-
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-1
110-
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.3-1
111-
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.4-1
112-
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-1
113-
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-1
109+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-2
110+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.3-2
111+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.4-2
112+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-2
113+
registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-2
114114
- run: go mod download
115115
- name: Build executable
116116
run: PGO_VERSION='${{ github.sha }}' make build-postgres-operator
@@ -132,17 +132,17 @@ jobs:
132132
--env 'CHECK_FOR_UPGRADES=false' \
133133
--env 'QUERIES_CONFIG_DIR=/mnt/hack/tools/queries' \
134134
--env 'KUBECONFIG=hack/.kube/postgres-operator/pgo' \
135-
--env 'RELATED_IMAGE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-33' \
136-
--env 'RELATED_IMAGE_PGBACKREST=registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.0-0' \
137-
--env 'RELATED_IMAGE_PGBOUNCER=registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-2' \
135+
--env 'RELATED_IMAGE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-34' \
136+
--env 'RELATED_IMAGE_PGBACKREST=registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.1-0' \
137+
--env 'RELATED_IMAGE_PGBOUNCER=registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-3' \
138138
--env 'RELATED_IMAGE_PGEXPORTER=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:latest' \
139139
--env 'RELATED_IMAGE_PGUPGRADE=registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:latest' \
140-
--env 'RELATED_IMAGE_POSTGRES_16=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-1' \
141-
--env 'RELATED_IMAGE_POSTGRES_16_GIS_3.3=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.3-1' \
142-
--env 'RELATED_IMAGE_POSTGRES_16_GIS_3.4=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.4-1' \
143-
--env 'RELATED_IMAGE_POSTGRES_17=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-1' \
144-
--env 'RELATED_IMAGE_POSTGRES_17_GIS_3.4=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-1' \
145-
--env 'RELATED_IMAGE_STANDALONE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.14-0' \
140+
--env 'RELATED_IMAGE_POSTGRES_16=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-2' \
141+
--env 'RELATED_IMAGE_POSTGRES_16_GIS_3.3=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.3-2' \
142+
--env 'RELATED_IMAGE_POSTGRES_16_GIS_3.4=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.4-2' \
143+
--env 'RELATED_IMAGE_POSTGRES_17=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-2' \
144+
--env 'RELATED_IMAGE_POSTGRES_17_GIS_3.4=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-2' \
145+
--env 'RELATED_IMAGE_STANDALONE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.14-1' \
146146
--env 'PGO_FEATURE_GATES=TablespaceVolumes=true' \
147147
--name 'postgres-operator' ubuntu \
148148
postgres-operator
@@ -157,7 +157,7 @@ jobs:
157157
KUTTL_PG_UPGRADE_TO_VERSION: '17'
158158
KUTTL_PG_VERSION: '16'
159159
KUTTL_POSTGIS_VERSION: '3.4'
160-
KUTTL_PSQL_IMAGE: 'registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-1'
160+
KUTTL_PSQL_IMAGE: 'registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-2'
161161
- run: |
162162
make check-kuttl && exit
163163
failed=$?

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ generate-kuttl: export KUTTL_PG_UPGRADE_FROM_VERSION ?= 15
229229
generate-kuttl: export KUTTL_PG_UPGRADE_TO_VERSION ?= 16
230230
generate-kuttl: export KUTTL_PG_VERSION ?= 16
231231
generate-kuttl: export KUTTL_POSTGIS_VERSION ?= 3.4
232-
generate-kuttl: export KUTTL_PSQL_IMAGE ?= registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1
232+
generate-kuttl: export KUTTL_PSQL_IMAGE ?= registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-2
233233
generate-kuttl: export KUTTL_TEST_DELETE_NAMESPACE ?= kuttl-test-delete-namespace
234234
generate-kuttl: ## Generate kuttl tests
235235
[ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated

config/manager/manager.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ spec:
2323
- name: CRUNCHY_DEBUG
2424
value: "true"
2525
- name: RELATED_IMAGE_POSTGRES_16
26-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-1"
26+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.6-2"
2727
- name: RELATED_IMAGE_POSTGRES_16_GIS_3.3
28-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.3-1"
28+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.3-2"
2929
- name: RELATED_IMAGE_POSTGRES_16_GIS_3.4
30-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.4-1"
30+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.6-3.4-2"
3131
- name: RELATED_IMAGE_POSTGRES_17
32-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-1"
32+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-2"
3333
- name: RELATED_IMAGE_POSTGRES_17_GIS_3.4
34-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-1"
34+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-2"
3535
- name: RELATED_IMAGE_PGADMIN
36-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-33"
36+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-34"
3737
- name: RELATED_IMAGE_PGBACKREST
38-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.0-0"
38+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.1-0"
3939
- name: RELATED_IMAGE_PGBOUNCER
40-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-2"
40+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-3"
4141
- name: RELATED_IMAGE_PGEXPORTER
4242
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:latest"
4343
- name: RELATED_IMAGE_PGUPGRADE
4444
value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:latest"
4545
- name: RELATED_IMAGE_STANDALONE_PGADMIN
46-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.14-0"
46+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.14-1"
4747
securityContext:
4848
allowPrivilegeEscalation: false
4949
capabilities: { drop: [ALL] }

internal/controller/postgrescluster/pgbackrest.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,18 +342,6 @@ func (r *Reconciler) cleanupRepoResources(ctx context.Context,
342342
delete = false
343343
}
344344
}
345-
case hasLabel(naming.LabelPGBackRestBackup):
346-
if !backupsSpecFound {
347-
break
348-
}
349-
// If a Job is identified for a repo that no longer exists in the spec then
350-
// delete it. Otherwise add it to the slice and continue.
351-
for _, repo := range postgresCluster.Spec.Backups.PGBackRest.Repos {
352-
if repo.Name == owned.GetLabels()[naming.LabelPGBackRestRepo] {
353-
ownedNoDelete = append(ownedNoDelete, owned)
354-
delete = false
355-
}
356-
}
357345
case hasLabel(naming.LabelPGBackRestCronJob):
358346
if !backupsSpecFound {
359347
break
@@ -368,6 +356,18 @@ func (r *Reconciler) cleanupRepoResources(ctx context.Context,
368356
break
369357
}
370358
}
359+
case hasLabel(naming.LabelPGBackRestBackup):
360+
if !backupsSpecFound {
361+
break
362+
}
363+
// If a Job is identified for a repo that no longer exists in the spec then
364+
// delete it. Otherwise add it to the slice and continue.
365+
for _, repo := range postgresCluster.Spec.Backups.PGBackRest.Repos {
366+
if repo.Name == owned.GetLabels()[naming.LabelPGBackRestRepo] {
367+
ownedNoDelete = append(ownedNoDelete, owned)
368+
delete = false
369+
}
370+
}
371371
case hasLabel(naming.LabelPGBackRestRestore):
372372
if !backupsSpecFound {
373373
break

internal/controller/postgrescluster/pgbackrest_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,6 @@ func TestReconcilePGBackRestRBAC(t *testing.T) {
727727
}
728728

729729
func TestReconcileRepoHostRBAC(t *testing.T) {
730-
// Garbage collector cleans up test resources before the test completes
731-
if strings.EqualFold(os.Getenv("USE_EXISTING_CLUSTER"), "true") {
732-
t.Skip("USE_EXISTING_CLUSTER: Test fails due to garbage collection")
733-
}
734730

735731
ctx := context.Background()
736732
_, tClient := setupKubernetes(t)
@@ -745,6 +741,15 @@ func TestReconcileRepoHostRBAC(t *testing.T) {
745741

746742
// create a PostgresCluster to test with
747743
postgresCluster := fakePostgresCluster(clusterName, ns.GetName(), clusterUID, true)
744+
// create an example AWS ARN annotation
745+
annotations := map[string]string{
746+
"eks.amazonaws.com/role-arn": "arn:aws:iam::123456768901:role/allow_bucket_access",
747+
}
748+
// set the annotation on the cluster
749+
postgresCluster.Spec.Metadata = &v1beta1.Metadata{
750+
Annotations: annotations,
751+
}
752+
748753
postgresCluster.Status.PGBackRest = &v1beta1.PGBackRestStatus{
749754
Repos: []v1beta1.RepoStatus{{Name: "repo1", StanzaCreated: false}},
750755
}
@@ -760,6 +765,7 @@ func TestReconcileRepoHostRBAC(t *testing.T) {
760765
Namespace: postgresCluster.GetNamespace(),
761766
}, sa)
762767
assert.NilError(t, err)
768+
assert.DeepEqual(t, sa.Annotations, annotations)
763769
}
764770

765771
func TestReconcileStanzaCreate(t *testing.T) {

0 commit comments

Comments
 (0)