Skip to content

Commit 26b5d33

Browse files
authored
Merge branch 'main' into K8SPG-574
2 parents 6505972 + 12d7fc4 commit 26b5d33

17 files changed

Lines changed: 108 additions & 24 deletions

File tree

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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13619,6 +13619,8 @@ spec:
1361913619
type: string
1362013620
type: object
1362113621
type: object
13622+
customClusterName:
13623+
type: string
1362213624
enabled:
1362313625
type: boolean
1362413626
image:
@@ -13633,6 +13635,8 @@ spec:
1363313635
- Never
1363413636
- IfNotPresent
1363513637
type: string
13638+
postgresParams:
13639+
type: string
1363613640
querySource:
1363713641
default: pgstatmonitor
1363813642
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
@@ -14024,6 +14024,8 @@ spec:
1402414024
type: string
1402514025
type: object
1402614026
type: object
14027+
customClusterName:
14028+
type: string
1402714029
enabled:
1402814030
type: boolean
1402914031
image:
@@ -14038,6 +14040,8 @@ spec:
1403814040
- Never
1403914041
- IfNotPresent
1404014042
type: string
14043+
postgresParams:
14044+
type: string
1404114045
querySource:
1404214046
default: pgstatmonitor
1404314047
enum:

deploy/bundle.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14317,6 +14317,8 @@ spec:
1431714317
type: string
1431814318
type: object
1431914319
type: object
14320+
customClusterName:
14321+
type: string
1432014322
enabled:
1432114323
type: boolean
1432214324
image:
@@ -14331,6 +14333,8 @@ spec:
1433114333
- Never
1433214334
- IfNotPresent
1433314335
type: string
14336+
postgresParams:
14337+
type: string
1433414338
querySource:
1433514339
default: pgstatmonitor
1433614340
enum:

deploy/cr.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ spec:
471471
# imagePullPolicy: IfNotPresent
472472
secret: cluster1-pmm-secret
473473
serverHost: monitoring-service
474+
# customClusterName: "<string>"
475+
# postgresParams: "<string>"
474476
# querySource: pgstatmonitor
475477
# patroni:
476478
# # Some values of the Liveness/Readiness probes of the patroni container are calculated using syncPeriodSeconds by the following formulas:

deploy/crd.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14317,6 +14317,8 @@ spec:
1431714317
type: string
1431814318
type: object
1431914319
type: object
14320+
customClusterName:
14321+
type: string
1432014322
enabled:
1432114323
type: boolean
1432214324
image:
@@ -14331,6 +14333,8 @@ spec:
1433114333
- Never
1433214334
- IfNotPresent
1433314335
type: string
14336+
postgresParams:
14337+
type: string
1433414338
querySource:
1433514339
default: pgstatmonitor
1433614340
enum:

deploy/cw-bundle.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14317,6 +14317,8 @@ spec:
1431714317
type: string
1431814318
type: object
1431914319
type: object
14320+
customClusterName:
14321+
type: string
1432014322
enabled:
1432114323
type: boolean
1432214324
image:
@@ -14331,6 +14333,8 @@ spec:
1433114333
- Never
1433214334
- IfNotPresent
1433314335
type: string
14336+
postgresParams:
14337+
type: string
1433414338
querySource:
1433514339
default: pgstatmonitor
1433614340
enum:

e2e-tests/functions

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ get_cr() {
181181
.spec.backups.pgbackrest.image = "'$IMAGE_BACKREST'" |
182182
.spec.proxy.pgBouncer.image = "'$IMAGE_PGBOUNCER'" |
183183
.spec.pmm.image = "'$IMAGE_PMM_CLIENT'" |
184-
.spec.pmm.secret = "'${cr_name}'-pmm-secret"
184+
.spec.pmm.secret = "'${cr_name}'-pmm-secret" |
185+
.spec.pmm.customClusterName = "'${cr_name}'-pmm-custom-name" |
186+
.spec.pmm.postgresParams = "--environment=dev-postgres"
185187
' $DEPLOY_DIR/cr.yaml >$TEMP_DIR/cr.yaml
186188

187189
if [[ $OPENSHIFT ]]; then
@@ -380,7 +382,7 @@ deploy_pmm3_server() {
380382
oc create rolebinding pmm-pg-operator-namespace-only --role percona-postgresql-operator --serviceaccount=$NAMESPACE:pmm-server -n "${NAMESPACE}"
381383
oc patch role/percona-postgresql-operator --type json -p='[{"op":"add","path": "/rules/-","value":{"apiGroups":["security.openshift.io"],"resources":["securitycontextconstraints"],"verbs":["use"],"resourceNames":["privileged"]}}]' -n "$NAMESPACE"
382384
fi
383-
helm install monitoring --set imageTag=${IMAGE_PMM3_SERVER#*:} --set imageRepo=${IMAGE_PMM3_SERVER%:*} --set platform=$platform --set sa=pmm-server --set supresshttp2=false https://percona-charts.storage.googleapis.com/pmm-server-${PMM3_SERVER_VERSION}.tgz -n "$NAMESPACE"
385+
helm install monitoring --set imageTag=${IMAGE_PMM3_SERVER#*:} --set imageRepo=${IMAGE_PMM3_SERVER%:*} --set platform=$platform --set sa=pmm-server --set supresshttp2=false https://percona-charts.storage.googleapis.com/pmm-server-${PMM_SERVER_VERSION}.tgz -n "$NAMESPACE"
384386
else
385387
platform=kubernetes
386388

0 commit comments

Comments
 (0)