Skip to content

Commit 5cd8a7d

Browse files
authored
Merge branch 'main' into K8SPG-613-test
2 parents 1af8946 + 2d3207f commit 5cd8a7d

53 files changed

Lines changed: 1364 additions & 98 deletions

Some content is hidden

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

.github/workflows/reviewdog.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ jobs:
1616
only-new-issues: true
1717
args: --timeout 5m
1818

19+
goimports-reviser:
20+
name: runner / suggester / goimports-reviser
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version: '^1.23'
27+
- run: go install -v github.com/incu6us/goimports-reviser/v3@latest
28+
- run: $(go env GOPATH)/bin/goimports-reviser -imports-order "std,general,company,project" -company-prefixes "github.com/percona" ./...
29+
- uses: reviewdog/action-suggester@v1
30+
with:
31+
tool_name: goimports-reviser
32+
1933
gofmt:
2034
name: runner / suggester / gofmt
2135
runs-on: ubuntu-latest

.github/workflows/scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
make build-docker-image
3232
3333
- name: Run Trivy vulnerability scanner image (linux/arm64)
34-
uses: aquasecurity/trivy-action@0.29.0
34+
uses: aquasecurity/trivy-action@0.30.0
3535
with:
3636
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64'
3737
format: 'table'
@@ -50,7 +50,7 @@ jobs:
5050
make build-docker-image
5151
5252
- name: Run Trivy vulnerability scanner image (linux/amd64)
53-
uses: aquasecurity/trivy-action@0.29.0
53+
uses: aquasecurity/trivy-action@0.30.0
5454
with:
5555
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64'
5656
format: 'table'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: [pull_request]
33
jobs:
44
test:
55
name: Test
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-latest
77
steps:
88
- name: Clone the code
99
uses: actions/checkout@v4

.golangci.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ linters:
66
- errchkjson
77
- gci
88
- gofumpt
9+
- goimports
910
enable:
1011
- depguard
1112
- gomodguard
@@ -49,9 +50,6 @@ linters-settings:
4950
exhaustive:
5051
default-signifies-exhaustive: true
5152

52-
goimports:
53-
local-prefixes: github.com/percona/percona-postgresql-operator
54-
5553
gomodguard:
5654
blocked:
5755
modules:

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ generate-crd: generate-crunchy-crd generate-percona-crd
326326
$(KUSTOMIZE) build ./config/crd/ > ./deploy/crd.yaml
327327

328328
generate-percona-crd:
329+
go generate ./percona/...
329330
GOBIN='$(CURDIR)/hack/tools' ./hack/controller-generator.sh \
330331
crd:crdVersions='v1' \
331332
paths='./pkg/apis/pgv2.percona.com/...' \

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

Lines changed: 6 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
@@ -8352,6 +8354,8 @@ spec:
83528354
properties:
83538355
pgAudit:
83548356
type: boolean
8357+
pgRepack:
8358+
type: boolean
83558359
pgStatMonitor:
83568360
type: boolean
83578361
pgStatStatements:
@@ -8400,6 +8404,8 @@ spec:
84008404
type: object
84018405
x-kubernetes-map-type: atomic
84028406
type: array
8407+
initImage:
8408+
type: string
84038409
instances:
84048410
description: |-
84058411
Specifies one or more sets of PostgreSQL pods that replicate data for

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

Lines changed: 8 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
@@ -8066,6 +8068,8 @@ spec:
80668068
properties:
80678069
pg_audit:
80688070
type: boolean
8071+
pg_repack:
8072+
type: boolean
80698073
pg_stat_monitor:
80708074
type: boolean
80718075
pgvector:
@@ -8201,6 +8205,8 @@ spec:
82018205
type: object
82028206
x-kubernetes-map-type: atomic
82038207
type: array
8208+
initImage:
8209+
type: string
82048210
instances:
82058211
description: |-
82068212
Specifies one or more sets of PostgreSQL pods that replicate data for
@@ -13633,6 +13639,8 @@ spec:
1363313639
- Never
1363413640
- IfNotPresent
1363513641
type: string
13642+
postgresParams:
13643+
type: string
1363613644
querySource:
1363713645
default: pgstatmonitor
1363813646
enum:

build/postgres-operator/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ RUN mkdir -p build/_output/bin \
2727
apt-get update -y && apt-get install gcc-x86-64-linux-gnu -y && export CC=x86_64-linux-gnu-gcc; \
2828
fi \
2929
&& CGO_ENABLED=$OPERATOR_CGO_ENABLED GOARCH=${TARGETARCH} GOOS=$GOOS GO_LDFLAGS=$GO_LDFLAGS \
30-
go build -ldflags "-w -s -X main.GitCommit=$GIT_COMMIT -X main.GitBranch=$GIT_BRANCH" \
30+
go build -ldflags "-w -s -X main.GitCommit=$GIT_COMMIT -X main.GitBranch=$GIT_BRANCH -X main.BuildTime=$BUILD_TIME" \
3131
-o build/_output/bin/postgres-operator \
3232
./cmd/postgres-operator \
3333
&& CGO_ENABLED=$EXTENSION_INSTALLER_CGO_ENABLED GOARCH=${TARGETARCH} GOOS=$GOOS GO_LDFLAGS=$GO_LDFLAGS \
34-
go build -ldflags "-w -s -X main.GitCommit=$GIT_COMMIT -X main.GitBranch=$GIT_BRANCH" \
34+
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)