Skip to content

Commit d9dd4a2

Browse files
committed
merge main
2 parents 169031a + cbe031e commit d9dd4a2

533 files changed

Lines changed: 226815 additions & 137710 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ CONTRIBUTING.md
77
LICENSE.md
88
README.md
99
.gitignore
10-
release_versions
10+
e2e-tests/release_versions
1111
.e2eignore

.github/ISSUE_TEMPLATE/1-feature-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Feature request 🧭
22
description: Suggest an idea for this project
3-
labels: "feature-request"
3+
labels: ["feature-request", "Proposed", "PG"]
44
body:
55
- type: textarea
66
attributes:

.github/workflows/reviewdog.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,43 @@ jobs:
103103
run: |
104104
make generate VERSION=main
105105
git diff --exit-code
106+
107+
e2e-release-versions-images:
108+
name: e2e-tests release_versions image availability
109+
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@v6
112+
with:
113+
fetch-depth: 0
114+
- name: Check if e2e-tests/release_versions changed
115+
id: changed
116+
run: |
117+
git fetch origin ${{ github.base_ref }}
118+
if git diff --name-only origin/${{ github.base_ref }}...HEAD -- e2e-tests/release_versions | grep -q .; then
119+
echo "changed=true" >> "$GITHUB_OUTPUT"
120+
else
121+
echo "changed=false" >> "$GITHUB_OUTPUT"
122+
fi
123+
- name: Verify release_versions images exist (docker manifest inspect)
124+
if: steps.changed.outputs.changed == 'true'
125+
run: |
126+
set -e
127+
# All IMAGE_*=value lines, exclude operator image (percona/percona-postgresql-operator)
128+
images=$(grep -E '^IMAGE_[^=]+=' e2e-tests/release_versions | cut -d= -f2 | grep -v '^$' | grep -v 'percona/percona-postgresql-operator' | sort -u)
129+
if [ -z "$images" ]; then
130+
echo "No non-operator images found in e2e-tests/release_versions"
131+
exit 0
132+
fi
133+
failed=""
134+
for img in $images; do
135+
echo "Checking image $img"
136+
if ! docker manifest inspect "$img"; then
137+
echo "::error::Image not found or inaccessible: $img"
138+
failed="${failed} ${img}"
139+
fi
140+
done
141+
if [ -n "$failed" ]; then
142+
echo "::error::The following images failed docker manifest inspect:$failed"
143+
exit 1
144+
fi
145+
echo "All images are available."

.github/workflows/scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
uses: actions/checkout@v6
1818

1919
- name: Set up QEMU
20-
uses: docker/setup-qemu-action@v3
20+
uses: docker/setup-qemu-action@v4
2121

2222
- name: Set up Docker Buildx
23-
uses: docker/setup-buildx-action@v3
23+
uses: docker/setup-buildx-action@v4
2424

2525
- name: Build an image from Dockerfile (linux/arm64)
2626
run: |

.golangci.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linters:
1313
- errchkjson
1414
- errorlint
1515
- exhaustive
16+
- forbidigo
1617
- gocheckcompilerdirectives
1718
- gochecksumtype
1819
- gomodguard
@@ -39,6 +40,10 @@ linters:
3940
disable:
4041
- contextcheck
4142
settings:
43+
forbidigo:
44+
forbid:
45+
- pattern: ^fmt\.Errorf$
46+
msg: "Do not use fmt.Errorf; use github.com/pkg/errors (errors.Errorf / errors.Wrap / errors.Wrapf) instead."
4247
depguard:
4348
rules:
4449
everything:
@@ -56,12 +61,8 @@ linters:
5661
desc: The "testing" packages should be used only in tests.
5762
- pkg: github.com/percona/percona-postgresql-operator/v2/internal/testing/*
5863
desc: The "internal/testing" packages should be used only in tests.
59-
tests:
60-
files:
61-
- $test
62-
deny:
63-
- pkg: github.com/pkg/errors
64-
desc: Use the "errors" package unless you are interacting with stack traces.
64+
- pkg: errors
65+
desc: Use "github.com/pkg/errors" instead (errors.Wrap/Wrapf/Errorf) for stack traces.
6566
errchkjson:
6667
check-error-free-encoding: true
6768
exhaustive:

Jenkinsfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,16 @@ void checkE2EIgnoreFiles() {
375375
echo "Excluded files: $excludedFiles"
376376
echo "Changed files: $changedFiles"
377377

378-
def excludedFilesRegex = excludedFiles.collect{it.replace("**", ".*").replace("*", "[^/]*")}
378+
// Use placeholder so the * in ".*" (from **) is not replaced by [^/]*
379+
def excludedFilesRegex = excludedFiles.collect{
380+
it.replace("**", ".__STARSTAR__").replace("*", "[^/]*").replace(".__STARSTAR__", ".*")
381+
}
379382
needToRunTests = !changedFiles.every{changed -> excludedFilesRegex.any{regex -> changed ==~ regex}}
380383

381384
if (needToRunTests) {
382385
echo "Some changed files are outside of the e2eignore list. Proceeding with execution."
383386
} else {
384-
if (currentBuild.previousBuild?.result != 'SUCCESS') {
387+
if (currentBuild.previousBuild?.result != 'SUCCESS' && currentBuild.number != 1) {
385388
echo "All changed files are e2eignore files, and previous build was unsuccessful. Propagating previous state."
386389
currentBuild.result = currentBuild.previousBuild?.result
387390
error "Skipping execution as non-significant changes detected and previous build was unsuccessful."

Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,22 +448,24 @@ update-version:
448448

449449
# Prepare release
450450
PG_VER ?= $(shell grep -o "postgresVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+")
451+
CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
451452
include e2e-tests/release_versions
452453
release: generate
454+
$(SED) -i "/CERT_MANAGER_VER/s/CERT_MANAGER_VER=\".*/CERT_MANAGER_VER=\"$(CERT_MANAGER_VER)\"/" e2e-tests/functions
453455
$(SED) -i \
454456
-e "/^spec:/,/^ crVersion:/{s/crVersion: .*/crVersion: $(VERSION)/}" \
455-
-e "/^spec:/,/^ image:/{/^#/! s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_POSTGRESQL17)#}" \
457+
-e "/^spec:/,/^ image:/{/^#/! s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_POSTGRESQL18)#}" \
456458
-e "s| image: docker.io/perconalab/percona-postgresql-operator:main| image: $(IMAGE)|" \
457-
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_PGBOUNCER17)#}" \
458-
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_BACKREST17)#}" \
459+
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_PGBOUNCER18)#}" \
460+
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_BACKREST18)#}" \
459461
-e "/extensions:/,/image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_OPERATOR)#}" \
460462
-e "/^ pmm:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_PMM3_CLIENT)#}" deploy/cr.yaml
461463
$(SED) -i -r "/Version *= \"[0-9]+\.[0-9]+\.[0-9]+\"$$/ s/[0-9]+\.[0-9]+\.[0-9]+/$(VERSION)/" pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go
462464
$(SED) -i \
463465
-e "/^spec:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_UPGRADE)#}" \
464-
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: $(REGISTRY_NAME_FULL)$(IMAGE_POSTGRESQL17)#}" \
465-
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: $(REGISTRY_NAME_FULL)$(IMAGE_PGBOUNCER17)#}" \
466-
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: $(REGISTRY_NAME_FULL)$(IMAGE_BACKREST17)#}" deploy/upgrade.yaml
466+
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: $(REGISTRY_NAME_FULL)$(IMAGE_POSTGRESQL18)#}" \
467+
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: $(REGISTRY_NAME_FULL)$(IMAGE_PGBOUNCER18)#}" \
468+
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: $(REGISTRY_NAME_FULL)$(IMAGE_BACKREST18)#}" deploy/upgrade.yaml
467469

468470
# Prepare main branch after release
469471
CURRENT_VERSION := $(shell grep -oE "crVersion: [0-9]+\.[0-9]+\.[0-9]+" deploy/cr.yaml | grep -oE "[0-9]+\.[0-9]+\.[0-9]+")
@@ -491,4 +493,4 @@ after-release: update-version generate
491493
# Update upgrade-consistency
492494
$(SED) -i "s/$(PREV2_VERSION)/$(PREV1_VERSION)/g" e2e-tests/tests/upgrade-consistency/01-*.yaml
493495
$(SED) -i "s/$(PREV1_VERSION)/$(CURRENT_VERSION)/g" e2e-tests/tests/upgrade-consistency/02-*.yaml
494-
$(SED) -i "s/$(CURRENT_VERSION)/$(NEXT_VER)/g" e2e-tests/tests/upgrade-consistency/03-*.yaml e2e-tests/tests/init-deploy/05-assert.yaml
496+
$(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)