Skip to content

Commit 2d3207f

Browse files
pooknullhors
andauthored
K8SPG-613: use percona-pgbackrest image (#1098)
* K8SPG-613: use percona-pgbackrest image https://perconadev.atlassian.net/browse/K8SPG-613 * fix * update image for tests * make generate * fix lint * rebuild images * fix lint * fix lint * add unit-tests * update yaml files --------- Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent 4000538 commit 2d3207f

File tree

25 files changed

+939
-37
lines changed

25 files changed

+939
-37
lines changed

build/crd/crunchy/generated/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ spec:
389389
pgBackRest repository hosts and backups. The image may also be set using
390390
the RELATED_IMAGE_PGBACKREST environment variable
391391
type: string
392+
initImage:
393+
type: string
392394
jobs:
393395
description: Jobs field allows configuration for all backup
394396
jobs
@@ -8402,6 +8404,8 @@ spec:
84028404
type: object
84038405
x-kubernetes-map-type: atomic
84048406
type: array
8407+
initImage:
8408+
type: string
84058409
instances:
84068410
description: |-
84078411
Specifies one or more sets of PostgreSQL pods that replicate data for

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ spec:
545545
pgBackRest repository hosts and backups. The image may also be set using
546546
the RELATED_IMAGE_PGBACKREST environment variable
547547
type: string
548+
initImage:
549+
type: string
548550
jobs:
549551
description: Jobs field allows configuration for all backup
550552
jobs
@@ -8203,6 +8205,8 @@ spec:
82038205
type: object
82048206
x-kubernetes-map-type: atomic
82058207
type: array
8208+
initImage:
8209+
type: string
82068210
instances:
82078211
description: |-
82088212
Specifies one or more sets of PostgreSQL pods that replicate data for

build/postgres-operator/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ RUN mkdir -p build/_output/bin \
3434
go build -ldflags "-w -s -X main.GitCommit=$GIT_COMMIT -X main.GitBranch=$GIT_BRANCH -X main.BuildTime=$BUILD_TIME" \
3535
-o build/_output/bin/extension-installer \
3636
./cmd/extension-installer \
37+
&& CGO_ENABLED=$PGBACKREST_CGO_ENABLED GOARCH=${TARGETARCH} GOOS=$GOOS GO_LDFLAGS=$GO_LDFLAGS \
38+
go build \
39+
-o build/_output/bin/pgbackrest ./cmd/pgbackrest \
3740
&& cp -r build/_output/bin/postgres-operator /usr/local/bin/postgres-operator \
38-
&& cp -r build/_output/bin/extension-installer /usr/local/bin/extension-installer
41+
&& cp -r build/_output/bin/extension-installer /usr/local/bin/extension-installer \
42+
&& cp -r build/_output/bin/pgbackrest /usr/local/bin/pgbackrest
3943

4044

4145
RUN ./bin/license_aggregator.sh ./cmd/...; \
@@ -55,8 +59,10 @@ COPY licenses /licenses
5559

5660
COPY --from=go_builder /usr/local/bin/postgres-operator /usr/local/bin
5761
COPY --from=go_builder /usr/local/bin/extension-installer /usr/local/bin
62+
COPY --from=go_builder /usr/local/bin/pgbackrest /usr/local/bin/
5863
COPY --from=go_builder /licenses /licenses
5964
COPY build/postgres-operator/install-extensions.sh /usr/local/bin
65+
COPY build/postgres-operator/init-entrypoint.sh /usr/local/bin
6066
COPY hack/tools/queries /opt/crunchy/conf
6167

6268
RUN chgrp -R 0 /opt/crunchy/conf && chmod -R g=u opt/crunchy/conf
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o xtrace
5+
6+
CRUNCHY_BINDIR="/opt/crunchy"
7+
8+
install -o "$(id -u)" -g "$(id -g)" -m 0755 -D "/usr/local/bin/pgbackrest" "${CRUNCHY_BINDIR}/bin/pgbackrest"

0 commit comments

Comments
 (0)