Skip to content

Commit 49fefce

Browse files
committed
Merge branch 'main' into K8SPG-552
2 parents 924dcbc + a0928c6 commit 49fefce

File tree

88 files changed

+5168
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+5168
-329
lines changed

.github/linters/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module linters
22

3-
go 1.25.1
3+
go 1.26.0

.github/workflows/reviewdog.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
steps:
88
- uses: actions/setup-go@v6
99
with:
10-
go-version: '^1.25.1'
10+
go-version: '^1.26.0'
1111
- uses: actions/checkout@v6
1212
- name: golangci-lint
1313
uses: golangci/golangci-lint-action@v9
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v6
2424
- uses: actions/setup-go@v6
2525
with:
26-
go-version: '^1.25.1'
26+
go-version: '^1.26.0'
2727
- run: go install -v github.com/incu6us/goimports-reviser/v3@latest
2828
- run: $(go env GOPATH)/bin/goimports-reviser -imports-order "std,general,company,project" -company-prefixes "github.com/percona" ./...
2929
- uses: reviewdog/action-suggester@v1
@@ -47,7 +47,7 @@ jobs:
4747
- uses: actions/checkout@v6
4848
- uses: actions/setup-go@v6
4949
with:
50-
go-version: '^1.25.1'
50+
go-version: '^1.26.0'
5151
- run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
5252
- run: $(go env GOPATH)/bin/shfmt -bn -ci -s -w .
5353
- name: suggester / shfmt

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Setup Go
1111
uses: actions/setup-go@v6
1212
with:
13-
go-version: '^1.25.1'
13+
go-version: '^1.26.0'
1414
- uses: actions/checkout@v6
1515
- name: Basic tests
1616
run: make check

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ pipeline {
506506
-v $WORKSPACE/src/github.com/percona/percona-postgresql-operator:/go/src/github.com/percona/percona-postgresql-operator \
507507
-w /go/src/github.com/percona/percona-postgresql-operator \
508508
-e GO111MODULE=on \
509-
golang:1.25.1 sh -c '
509+
golang:1.26.0 sh -c '
510510
go install github.com/google/go-licenses@latest;
511511
/go/bin/go-licenses csv github.com/percona/percona-postgresql-operator/v2/cmd/postgres-operator \
512512
| cut -d , -f 3 \

build/crd/percona/generated/pgv2.percona.com_perconapgbackups.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ spec:
7070
type: object
7171
spec:
7272
properties:
73+
method:
74+
default: pgbackrest
75+
description: Method with which to perform the backup
76+
enum:
77+
- pgbackrest
78+
- volumeSnapshot
79+
type: string
7380
options:
7481
description: |-
7582
Command line options to include when running the pgBackRest backup command.
@@ -80,14 +87,17 @@ spec:
8087
pgCluster:
8188
type: string
8289
repoName:
83-
description: The name of the pgBackRest repo to run the backup command
84-
against.
90+
description: |-
91+
The name of the pgBackRest repo to run the backup command against.
92+
This is required when method is 'pgbackrest'.
8593
pattern: ^repo[1-4]
8694
type: string
8795
required:
8896
- pgCluster
89-
- repoName
9097
type: object
98+
x-kubernetes-validations:
99+
- message: repoName is required when method is 'pgbackrest'
100+
rule: self.method == "volumeSnapshot" || has(self.repoName)
91101
status:
92102
properties:
93103
backupName:
@@ -391,6 +401,24 @@ spec:
391401
required:
392402
- name
393403
type: object
404+
snapshot:
405+
properties:
406+
dataVolumeSnapshotRef:
407+
description: Name of the VolumeSnapshot containing data volume
408+
contents.
409+
type: string
410+
tablespaceVolumeSnapshotRefs:
411+
additionalProperties:
412+
type: string
413+
description: |-
414+
Names of the VolumeSnapshots containing tablespace volume contents.
415+
Key is the name of the tablespace, value is the name of the VolumeSnapshot.
416+
type: object
417+
walVolumeSnapshotRef:
418+
description: Name of the VolumeSnapshot containing WAL volume
419+
contents.
420+
type: string
421+
type: object
394422
state:
395423
type: string
396424
storageType:

build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7110,6 +7110,51 @@ spec:
71107110
trackLatestRestorableTime:
71117111
description: Enable tracking latest restorable time
71127112
type: boolean
7113+
volumeSnapshots:
7114+
description: VolumeSnapshots configuration
7115+
properties:
7116+
className:
7117+
description: Name of the VolumeSnapshotClass to use.
7118+
type: string
7119+
mode:
7120+
default: offline
7121+
description: Mode of the VolumeSnapshot.
7122+
enum:
7123+
- offline
7124+
type: string
7125+
offlineConfig:
7126+
description: |-
7127+
Configuration for offline snapshot operations.
7128+
Ignored if mode is not offline.
7129+
properties:
7130+
checkpoint:
7131+
description: Checkpoint configuration for offline snapshot
7132+
operations.
7133+
properties:
7134+
enabled:
7135+
default: true
7136+
description: If set, a checkpoint is requested.
7137+
type: boolean
7138+
timeoutSeconds:
7139+
default: 300
7140+
description: |-
7141+
Timeout for the checkpoint operation.
7142+
Ignored if checkpoint is not enabled.
7143+
format: int32
7144+
minimum: 30
7145+
type: integer
7146+
type: object
7147+
type: object
7148+
schedule:
7149+
description: |-
7150+
Defines the Cron schedule for a VolumeSnapshot.
7151+
Follows the standard Cron schedule syntax:
7152+
https://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax
7153+
minLength: 6
7154+
type: string
7155+
required:
7156+
- className
7157+
type: object
71137158
type: object
71147159
x-kubernetes-validations:
71157160
- message: At least one repository must be configured when backups

build/crd/percona/generated/pgv2.percona.com_perconapgrestores.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,33 @@ spec:
6767
pgCluster:
6868
description: The name of the PerconaPGCluster to perform restore.
6969
type: string
70+
x-kubernetes-validations:
71+
- message: pgCluster is an immutable field
72+
rule: self == oldSelf
7073
repoName:
7174
description: |-
7275
The name of the pgBackRest repo within the source PostgresCluster that contains the backups
7376
that should be utilized to perform a pgBackRest restore when initializing the data source
7477
for the new PostgresCluster.
7578
pattern: ^repo[1-4]
7679
type: string
80+
x-kubernetes-validations:
81+
- message: repoName is an immutable field
82+
rule: self == oldSelf
83+
volumeSnapshotBackupName:
84+
description: The name of the backup to perform in-place volume snapshot
85+
restores from.
86+
type: string
87+
x-kubernetes-validations:
88+
- message: volumeSnapshotBackupName is an immutable field
89+
rule: self == oldSelf
7790
required:
7891
- pgCluster
79-
- repoName
8092
type: object
93+
x-kubernetes-validations:
94+
- message: either repoName or volumeSnapshotBackupName must be set
95+
rule: ((has(self.repoName) && self.repoName != "") || (has(self.volumeSnapshotBackupName)
96+
&& self.volumeSnapshotBackupName != ""))
8197
status:
8298
properties:
8399
completed:

build/postgres-operator/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG BASE_IMAGE=ubi10
22

3-
FROM --platform=${BUILDPLATFORM} golang:1.25 AS go_builder
3+
FROM --platform=${BUILDPLATFORM} golang:1.26 AS go_builder
44
WORKDIR /go/src/github.com/percona/percona-postgresql-operator
55

66
COPY go.mod go.sum ./
@@ -69,6 +69,7 @@ COPY build/postgres-operator/init-entrypoint.sh /usr/local/bin
6969
COPY build/postgres-operator/postgres-entrypoint.sh /usr/local/bin
7070
COPY build/postgres-operator/postgres-liveness-check.sh /usr/local/bin
7171
COPY build/postgres-operator/postgres-readiness-check.sh /usr/local/bin
72+
COPY build/postgres-operator/restore-command-wrapper.sh /usr/local/bin
7273
COPY hack/tools/queries /opt/crunchy/conf
7374

7475
RUN chgrp -R 0 /opt/crunchy/conf && chmod -R g=u opt/crunchy/conf

build/postgres-operator/init-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ install -o "$(id -u)" -g "$(id -g)" -m 0755 -D "/usr/local/bin/postgres-entrypoi
1010
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D "/usr/local/bin/postgres-liveness-check.sh" "${CRUNCHY_BINDIR}/bin/postgres-liveness-check.sh"
1111
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D "/usr/local/bin/postgres-readiness-check.sh" "${CRUNCHY_BINDIR}/bin/postgres-readiness-check.sh"
1212
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D "/usr/local/bin/relocate-extensions.sh" "${CRUNCHY_BINDIR}/bin/relocate-extensions.sh"
13+
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D "/usr/local/bin/restore-command-wrapper.sh" "${CRUNCHY_BINDIR}/bin/restore-command-wrapper.sh"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# When this marker exists (e.g. after a snapshot restore), skip all WAL recovery by
5+
# exiting non-zero. Do not remove the file so every restore_command call is skipped.
6+
if [ -f "${PGDATA}/skip-wal-recovery" ]; then
7+
exit 1
8+
fi
9+
10+
exec "$@"

0 commit comments

Comments
 (0)