Skip to content

Commit 8e0be14

Browse files
authored
Merge branch 'main' into K8SPG-704
2 parents 2170dad + b5e7836 commit 8e0be14

34 files changed

+317
-56
lines changed

.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'

.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/percona/generated/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13626,6 +13626,8 @@ spec:
1362613626
type: string
1362713627
type: object
1362813628
type: object
13629+
customClusterName:
13630+
type: string
1362913631
enabled:
1363013632
type: boolean
1363113633
image:
@@ -13640,6 +13642,8 @@ spec:
1364013642
- Never
1364113643
- IfNotPresent
1364213644
type: string
13645+
postgresParams:
13646+
type: string
1364313647
querySource:
1364413648
default: pgstatmonitor
1364513649
enum:

build/postgres-operator/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ 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 \
3737
&& cp -r build/_output/bin/postgres-operator /usr/local/bin/postgres-operator \

cmd/postgres-operator/main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"context"
99
"fmt"
1010
"os"
11+
goruntime "runtime"
1112
"strconv"
1213
"strings"
1314
"time"
@@ -47,7 +48,12 @@ import (
4748
"github.com/percona/percona-postgresql-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
4849
)
4950

50-
var versionString string
51+
var (
52+
GitCommit string
53+
GitBranch string
54+
BuildTime string
55+
versionString string
56+
)
5157

5258
// assertNoError panics when err is not nil.
5359
func assertNoError(err error) {
@@ -74,6 +80,9 @@ func main() {
7480
log := logging.FromContext(ctx)
7581
log.V(1).Info("debug flag set to true")
7682

83+
log.Info("Manager starting up", "gitCommit", GitCommit, "gitBranch", GitBranch,
84+
"buildTime", BuildTime, "goVersion", goruntime.Version(), "os", goruntime.GOOS, "arch", goruntime.GOARCH)
85+
7786
features := feature.NewGate()
7887
err = features.SetFromMap(map[string]bool{
7988
string(feature.InstanceSidecars): true, // needed for PMM

config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14031,6 +14031,8 @@ spec:
1403114031
type: string
1403214032
type: object
1403314033
type: object
14034+
customClusterName:
14035+
type: string
1403414036
enabled:
1403514037
type: boolean
1403614038
image:
@@ -14045,6 +14047,8 @@ spec:
1404514047
- Never
1404614048
- IfNotPresent
1404714049
type: string
14050+
postgresParams:
14051+
type: string
1404814052
querySource:
1404914053
default: pgstatmonitor
1405014054
enum:

config/crd/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ resources:
77
- bases/pgv2.percona.com_perconapgclusters.yaml
88
- bases/postgres-operator.crunchydata.com_pgupgrades.yaml
99
- bases/postgres-operator.crunchydata.com_pgadmins.yaml
10+
11+
patchesStrategicMerge:
12+
- patches/versionlabel_in_perconapgclusters.yaml
13+
- patches/versionlabel_in_perconapgbackups.yaml
14+
- patches/versionlabel_in_perconapgrestores.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: perconapgbackups.pgv2.percona.com
5+
labels:
6+
pgv2.percona.com/version: v2.7.0

0 commit comments

Comments
 (0)