Skip to content

Commit a22c725

Browse files
authored
Merge branch 'main' into K8SPG-903
2 parents 95295de + 74b9009 commit a22c725

250 files changed

Lines changed: 8617 additions & 1906 deletions

File tree

Some content is hidden

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

.e2eignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ README.md
99
.gitignore
1010
release_versions
1111
.e2eignore
12-
.snyk

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
* @hors @egegunes @pooknull @nmarukovich @gkech
2-
/e2e-tests/ @jvpasinatto @eleo007 @valmiranogueira
1+
* @hors @egegunes @pooknull @nmarukovich @gkech @mayankshah1607 @oksana-grishchenko
2+
/e2e-tests/ @jvpasinatto @eleo007 @valmiranogueira @egegunes @pooknull @nmarukovich @gkech @mayankshah1607 @oksana-grishchenko
33
Jenkinsfile @jvpasinatto @eleo007 @valmiranogueira

.github/pr-badge.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/reviewdog.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
- uses: actions/setup-go@v6
99
with:
1010
go-version: '^1.25.1'
11-
- uses: actions/checkout@v5
11+
- uses: actions/checkout@v6
1212
- name: golangci-lint
13-
uses: golangci/golangci-lint-action@v8
13+
uses: golangci/golangci-lint-action@v9
1414
with:
1515
version: latest
1616
only-new-issues: true
@@ -20,7 +20,7 @@ jobs:
2020
name: runner / suggester / goimports-reviser
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424
- uses: actions/setup-go@v6
2525
with:
2626
go-version: '^1.25.1'
@@ -34,7 +34,7 @@ jobs:
3434
name: runner / suggester / gofmt
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
3838
- run: gofmt -w -s $(find . -not -path "*/vendor/*" -name "*.go")
3939
- uses: reviewdog/action-suggester@v1
4040
with:
@@ -44,7 +44,7 @@ jobs:
4444
name: runner / suggester / shfmt
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v5
47+
- uses: actions/checkout@v6
4848
- uses: actions/setup-go@v6
4949
with:
5050
go-version: '^1.25.1'
@@ -60,7 +60,7 @@ jobs:
6060
name: runner / shellcheck
6161
runs-on: ubuntu-latest
6262
steps:
63-
- uses: actions/checkout@v5
63+
- uses: actions/checkout@v6
6464
- uses: reviewdog/action-shellcheck@v1
6565
with:
6666
github_token: ${{ secrets.github_token }}
@@ -70,7 +70,7 @@ jobs:
7070
name: runner / misspell
7171
runs-on: ubuntu-latest
7272
steps:
73-
- uses: actions/checkout@v5
73+
- uses: actions/checkout@v6
7474
- uses: reviewdog/action-misspell@v1
7575
with:
7676
github_token: ${{ secrets.github_token }}
@@ -81,7 +81,7 @@ jobs:
8181
name: runner / alex
8282
runs-on: ubuntu-latest
8383
steps:
84-
- uses: actions/checkout@v5
84+
- uses: actions/checkout@v6
8585
- uses: reviewdog/action-alex@v1
8686
with:
8787
github_token: ${{ secrets.github_token }}
@@ -92,7 +92,14 @@ jobs:
9292
name: runner / manifests
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@v5
96-
- run: |
95+
- uses: actions/checkout@v6
96+
- name: check on release branch
97+
if: ${{ contains(github.base_ref, 'release-') }}
98+
run: |
99+
make generate VERSION="$(cat percona/version/version.txt)" IMAGE_TAG_BASE="percona/percona-postgresql-operator"
100+
git diff --exit-code
101+
- name: check on non release branches
102+
if: ${{ ! contains(github.base_ref, 'release-') }}
103+
run: |
97104
make generate VERSION=main
98105
git diff --exit-code

.github/workflows/scan.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v5
17+
uses: actions/checkout@v6
1818

1919
- name: Set up QEMU
2020
uses: docker/setup-qemu-action@v3
@@ -30,32 +30,10 @@ jobs:
3030
export DOCKER_DEFAULT_PLATFORM='linux/arm64'
3131
make build-docker-image
3232
33-
- name: Run Trivy vulnerability scanner image (linux/arm64)
34-
uses: aquasecurity/trivy-action@0.33.1
35-
with:
36-
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64'
37-
format: 'table'
38-
exit-code: '1'
39-
ignore-unfixed: true
40-
vuln-type: 'os,library'
41-
severity: 'CRITICAL,HIGH'
42-
version: 'v0.57.1'
43-
4433
- name: Build an image from Dockerfile (linux/amd64)
4534
run: |
4635
export IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64
4736
export DOCKER_PUSH=0
4837
export DOCKER_SQUASH=0
4938
export DOCKER_DEFAULT_PLATFORM='linux/amd64'
5039
make build-docker-image
51-
52-
- name: Run Trivy vulnerability scanner image (linux/amd64)
53-
uses: aquasecurity/trivy-action@0.33.1
54-
with:
55-
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64'
56-
format: 'table'
57-
exit-code: '1'
58-
ignore-unfixed: true
59-
vuln-type: 'os,library'
60-
severity: 'CRITICAL,HIGH'
61-
version: 'v0.57.1'

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Clone the code
9-
uses: actions/checkout@v5
9+
uses: actions/checkout@v6
1010
- name: Setup Go
1111
uses: actions/setup-go@v6
1212
with:
1313
go-version: '^1.25.1'
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
- name: Basic tests
1616
run: make check
1717
- name: envtest
18-
run: ENVTEST_K8S_VERSION=1.32 make check-envtest
18+
run: ENVTEST_K8S_VERSION=1.35 make check-envtest

.snyk

Lines changed: 0 additions & 10 deletions
This file was deleted.

Jenkinsfile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ void createCluster(String CLUSTER_SUFFIX) {
88
export KUBECONFIG=/tmp/$CLUSTER_NAME-${CLUSTER_SUFFIX}
99
gcloud auth activate-service-account --key-file $CLIENT_SECRET_FILE
1010
gcloud config set project $GCP_PROJECT
11+
12+
printf 'linuxConfig:\n hugepageConfig:\n hugepage_size2m: 1024\n' > ${WORKSPACE}/hugepages-config-${CLUSTER_SUFFIX}.yaml
13+
1114
ret_num=0
1215
while [ \${ret_num} -lt 15 ]; do
1316
ret_val=0
@@ -16,7 +19,7 @@ void createCluster(String CLUSTER_SUFFIX) {
1619
--preemptible \
1720
--zone=${region} \
1821
--machine-type='n1-standard-4' \
19-
--cluster-version='1.31' \
22+
--cluster-version='1.32' \
2023
--num-nodes=3 \
2124
--labels='delete-cluster-after-hours=6' \
2225
--disk-size=30 \
@@ -28,11 +31,15 @@ void createCluster(String CLUSTER_SUFFIX) {
2831
--monitoring=NONE \
2932
--logging=NONE \
3033
--no-enable-managed-prometheus \
34+
--system-config-from-file=${WORKSPACE}/hugepages-config-${CLUSTER_SUFFIX}.yaml \
3135
--quiet && \
3236
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user jenkins@"$GCP_PROJECT".iam.gserviceaccount.com || ret_val=\$?
3337
if [ \${ret_val} -eq 0 ]; then break; fi
3438
ret_num=\$((ret_num + 1))
3539
done
40+
41+
rm -f ${WORKSPACE}/hugepages-config-${CLUSTER_SUFFIX}.yaml
42+
3643
if [ \${ret_num} -eq 15 ]; then
3744
gcloud container clusters list --filter $CLUSTER_NAME-${CLUSTER_SUFFIX} --zone ${region} --format='csv[no-heading](name)' | xargs gcloud container clusters delete --zone ${region} --quiet || true
3845
exit 1
@@ -91,7 +98,7 @@ void pushLogFile(String FILE_NAME) {
9198
def LOG_FILE_PATH="e2e-tests/logs/${FILE_NAME}.log"
9299
def LOG_FILE_NAME="${FILE_NAME}.log"
93100
echo "Push logfile $LOG_FILE_NAME file to S3!"
94-
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AMI/OVF', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
101+
withCredentials([aws(credentialsId: 'AMI/OVF', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
95102
sh """
96103
S3_PATH=s3://percona-jenkins-artifactory-public/\$JOB_NAME/\$(git rev-parse --short HEAD)
97104
aws s3 ls \$S3_PATH/${LOG_FILE_NAME} || :
@@ -103,7 +110,7 @@ void pushLogFile(String FILE_NAME) {
103110
void pushArtifactFile(String FILE_NAME) {
104111
echo "Push $FILE_NAME file to S3!"
105112

106-
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AMI/OVF', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
113+
withCredentials([aws(credentialsId: 'AMI/OVF', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
107114
sh """
108115
touch ${FILE_NAME}
109116
S3_PATH=s3://percona-jenkins-artifactory/\$JOB_NAME/\$(git rev-parse --short HEAD)
@@ -128,7 +135,7 @@ void initTests() {
128135
void markPassedTests() {
129136
echo "Marking passed tests in the tests map!"
130137

131-
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AMI/OVF', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
138+
withCredentials([aws(credentialsId: 'AMI/OVF', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
132139
sh """
133140
aws s3 ls "s3://percona-jenkins-artifactory/${JOB_NAME}/${env.GIT_SHORT_COMMIT}/" || :
134141
"""
@@ -287,7 +294,7 @@ void prepareNode() {
287294
sudo curl -sLo /usr/local/bin/kubectl https://dl.k8s.io/release/\$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && sudo chmod +x /usr/local/bin/kubectl
288295
kubectl version --client --output=yaml
289296
290-
curl -fsSL https://get.helm.sh/helm-v3.18.3-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm
297+
curl -fsSL https://get.helm.sh/helm-v3.20.0-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm
291298
292299
sudo curl -fsSL https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 -o /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq
293300
sudo curl -fsSL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux64 -o /usr/local/bin/jq && sudo chmod +x /usr/local/bin/jq
@@ -298,8 +305,8 @@ void prepareNode() {
298305
299306
kubectl krew install assert
300307
301-
# v0.22.0 kuttl version
302-
kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/02d5befb2bc9554fdcd8386b8bfbed2732d6802e/plugins/kuttl.yaml
308+
# v0.24.0 kuttl version
309+
kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/b913fddcbdb8e7d2b3d837ec159460671bb22796/plugins/kuttl.yaml
303310
echo \$(kubectl kuttl --version) is installed
304311
305312
sudo tee /etc/yum.repos.d/google-cloud-sdk.repo << EOF
@@ -467,7 +474,7 @@ pipeline {
467474
mkdir -p $(dirname ${docker_tag_file})
468475
echo ${DOCKER_TAG} > "${docker_tag_file}"
469476
sg docker -c "
470-
docker login -u '${USER}' -p '${PASS}'
477+
echo '\$PASS' | docker login -u '\$USER' --password-stdin
471478
export RELEASE=0
472479
export IMAGE=\$DOCKER_TAG
473480
docker buildx create --use
@@ -589,7 +596,7 @@ pipeline {
589596
}
590597
}
591598
makeReport()
592-
step([$class: 'JUnitResultArchiver', testResults: '*.xml', healthScaleFactor: 1.0])
599+
junit testResults: '*.xml', healthScaleFactor: 1.0
593600
archiveArtifacts '*.xml'
594601

595602
unstash 'IMAGE'

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ rm -rf $$TMP_DIR ;\
443443
}
444444
endef
445445

446+
update-version:
447+
echo $(NEXT_VER) > percona/version/version.txt
448+
446449
# Prepare release
447450
PG_VER ?= $(shell grep -o "postgresVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+")
448451
include e2e-tests/release_versions
@@ -469,11 +472,11 @@ MINOR_VER := $(word 2,$(subst ., ,$(CURRENT_VERSION)))
469472
NEXT_VER := $(MAJOR_VER).$(shell expr $(MINOR_VER) + 1).0
470473
PREV1_VERSION := $(MAJOR_VER).$(shell expr $(MINOR_VER) - 1).0
471474
PREV2_VERSION := $(MAJOR_VER).$(shell expr $(MINOR_VER) - 2).0
472-
after-release: generate
473-
echo $(NEXT_VER) > percona/version/version.txt
475+
after-release: update-version generate
474476
$(SED) -i \
475477
-e "/^spec:/,/^ crVersion:/{s/crVersion: .*/crVersion: $(NEXT_VER)/}" \
476478
-e "/^spec:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-postgres#}" \
479+
-e "/initContainer:/,/image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main#}" \
477480
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbouncer$(PG_VER)#}" \
478481
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbackrest$(PG_VER)#}" \
479482
-e "/extensions:/,/image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main#}" \
@@ -484,6 +487,8 @@ after-release: generate
484487
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-postgres#}" \
485488
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbouncer$(PG_VER)#}" \
486489
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbackrest$(PG_VER)#}" deploy/upgrade.yaml
490+
491+
# Update upgrade-consistency
487492
$(SED) -i "s/$(PREV2_VERSION)/$(PREV1_VERSION)/g" e2e-tests/tests/upgrade-consistency/01-*.yaml
488493
$(SED) -i "s/$(PREV1_VERSION)/$(CURRENT_VERSION)/g" e2e-tests/tests/upgrade-consistency/02-*.yaml
489494
$(SED) -i "s/$(CURRENT_VERSION)/$(NEXT_VER)/g" e2e-tests/tests/upgrade-consistency/03-*.yaml e2e-tests/tests/init-deploy/05-assert.yaml

0 commit comments

Comments
 (0)