Skip to content

Commit a03cc95

Browse files
rebase to IVYO_REL_5_STABLE (#84)
* update image release version for ivorysql 5.1 * lint workflow error fix --------- Co-authored-by: gaoxueyu <44825804+gaoxueyu@users.noreply.github.com>
1 parent fe579b1 commit a03cc95

42 files changed

Lines changed: 241 additions & 294 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/lint.yaml

Lines changed: 14 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,29 @@ name: Linters
22

33
on:
44
pull_request:
5-
branches:
6-
- master
75

86
jobs:
9-
documentation:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
14-
# Some versions of Ubuntu have an awk that does not recognize POSIX classes.
15-
# Log the version of awk and abort when it cannot match space U+0020.
16-
# - https://bugs.launchpad.net/ubuntu/+source/mawk/+bug/69724
17-
- run: awk -W version && awk '{ exit 1 != match($0, /[[:space:]]/) }' <<< ' '
18-
- run: |
19-
find docs/content -not -type d -not -name crd.md -print0 | xargs -0 awk '
20-
BEGIN { print "::add-matcher::.github/actions/awk-matcher.json" }
21-
22-
/[[:space:]]$/ { errors++; print FILENAME ":" FNR " error: Trailing space" }
23-
/TODO/ { errors++; print FILENAME ":" FNR " error: Found TODO. Try running hack/create-todo-patch.sh" }
24-
25-
END { print "::remove-matcher owner=awk::" }
26-
END { exit errors != 0 }
27-
'
28-
29-
documentation-crd:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v3
33-
34-
# The `documentation-crd` job only checks the crd.md for `TODO`,
35-
# as some of the upstream documentation has trailing spaces
36-
- run: |
37-
find docs/content -name crd.md -print0 | xargs -0 awk '
38-
BEGIN { print "::add-matcher::.github/actions/awk-matcher.json" }
39-
40-
/TODO/ { errors++; print FILENAME ":" FNR " error: Found TODO. Try running hack/create-todo-patch.sh" }
41-
42-
END { print "::remove-matcher owner=awk::" }
43-
END { exit errors != 0 }
44-
'
45-
467
golangci-lint:
47-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-24.04
9+
permissions:
10+
contents: read
11+
checks: write
4812
steps:
49-
- uses: actions/checkout@v3
50-
- uses: actions/setup-go@v3
51-
with: { go-version: 1.x }
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-go@v6
15+
with: { go-version: stable }
5216

53-
- uses: golangci/golangci-lint-action@v3
17+
- uses: golangci/golangci-lint-action@v9
5418
with:
55-
version: v1.60.1
19+
version: latest
5620
args: --timeout=5m
5721

5822
# Count issues reported by disabled linters. The command always
5923
# exits zero to ensure it does not fail the pull request check.
6024
- name: Count non-blocking issues
6125
run: |
62-
golangci-lint run --config .golangci.next.yaml \
63-
--issues-exit-code 0 \
64-
--max-issues-per-linter 0 \
65-
--max-same-issues 0 \
66-
--out-format json |
67-
jq --sort-keys 'reduce .Issues[] as $i ({}; .[$i.FromLinter] += 1)' |
68-
awk >> "${GITHUB_STEP_SUMMARY}" '
69-
NR == 1 { print "```json" } { print } END { if (NR > 0) print "```" }
70-
' || true
26+
golangci-lint run --config .golangci.next.yaml --show-stats >> "${GITHUB_STEP_SUMMARY}" \
27+
--max-issues-per-linter=0 \
28+
--max-same-issues=0 \
29+
--uniq-by-line=0 \
30+
--output.text.path=/dev/null ||:

.github/workflows/test.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ jobs:
6464
with:
6565
k3s-channel: "${{ matrix.kubernetes }}"
6666
prefetch-images: |
67-
docker.io/ivorysql/pgbackrest:ubi8-2.56.0-5.0-1
68-
docker.io/ivorysql/pgbouncer:ubi8-1.23.0-5.0-1
69-
docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1
67+
docker.io/ivorysql/pgbackrest:ubi9-2.56.0-5.1-1
68+
docker.io/ivorysql/pgbouncer:ubi9-1.24.0-5.1-1
69+
docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1
7070
7171
- run: make createnamespaces check-envtest-existing
7272
env:
@@ -98,13 +98,13 @@ jobs:
9898
with:
9999
k3s-channel: "${{ matrix.kubernetes }}"
100100
prefetch-images: |
101-
docker.io/ivorysql/pgadmin:ubi8-9.9-5.0-1
102-
docker.io/ivorysql/pgbackrest:ubi8-2.56.0-5.0-1
103-
docker.io/ivorysql/pgbouncer:ubi8-1.23.0-5.0-1
104-
docker.io/ivorysql/postgres-exporter:ubi8-0.17.0-5.0-1
105-
docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1
106-
docker.io/ivorysql/postgis:ubi8-3.5-5.0-1
107-
registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi8-5.3.1-0
101+
docker.io/ivorysql/pgadmin:ubi9-9.9-5.1-1
102+
docker.io/ivorysql/pgbackrest:ubi9-2.56.0-5.1-1
103+
docker.io/ivorysql/pgbouncer:ubi9-1.24.0-5.1-1
104+
docker.io/ivorysql/postgres-exporter:ubi9-0.17.0-5.1-1
105+
docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1
106+
docker.io/ivorysql/postgis:ubi9-3.5-5.1-1
107+
registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi9-5.3.1-0
108108
- run: go mod download
109109
- name: Build executable
110110
run: IVYO_VERSION='${{ github.sha }}' make build-ivory-operator
@@ -118,13 +118,13 @@ jobs:
118118
docker run --detach --network host --read-only \
119119
--volume "$(pwd):/mnt" --workdir '/mnt' --env 'PATH=/mnt/bin' \
120120
--env 'KUBECONFIG=hack/.kube/ivory-operator/ivyo' \
121-
--env 'RELATED_IMAGE_PGADMIN=docker.io/ivorysql/pgadmin:ubi8-9.9-5.0-1' \
122-
--env 'RELATED_IMAGE_PGBACKREST=docker.io/ivorysql/pgbackrest:ubi8-2.56.0-5.0-1' \
123-
--env 'RELATED_IMAGE_PGBOUNCER=docker.io/ivorysql/pgbouncer:ubi8-1.23.0-5.0-1' \
124-
--env 'RELATED_IMAGE_PGEXPORTER=docker.io/ivorysql/postgres-exporter:ubi8-0.17.0-5.0-1' \
125-
--env 'RELATED_IMAGE_PGUPGRADE=registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi8-5.3.1-0' \
126-
--env 'RELATED_IMAGE_IVORY_18=docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1' \
127-
--env 'RELATED_IMAGE_IVORY_18_GIS_3.5=docker.io/ivorysql/postgis:ubi8-3.5-5.0-1' \
121+
--env 'RELATED_IMAGE_PGADMIN=docker.io/ivorysql/pgadmin:ubi9-9.9-5.1-1' \
122+
--env 'RELATED_IMAGE_PGBACKREST=docker.io/ivorysql/pgbackrest:ubi9-2.56.0-5.1-1' \
123+
--env 'RELATED_IMAGE_PGBOUNCER=docker.io/ivorysql/pgbouncer:ubi9-1.24.0-5.1-1' \
124+
--env 'RELATED_IMAGE_PGEXPORTER=docker.io/ivorysql/postgres-exporter:ubi9-0.17.0-5.1-1' \
125+
--env 'RELATED_IMAGE_PGUPGRADE=registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi9-5.3.1-0' \
126+
--env 'RELATED_IMAGE_IVORY_18=docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1' \
127+
--env 'RELATED_IMAGE_IVORY_18_GIS_3.5=docker.io/ivorysql/postgis:ubi9-3.5-5.1-1' \
128128
--env 'IVYO_FEATURE_GATES=TablespaceVolumes=true' \
129129
--name 'ivory-operator' ubuntu \
130130
ivory-operator
@@ -139,7 +139,7 @@ jobs:
139139
KUTTL_PG_UPGRADE_TO_VERSION: '18'
140140
KUTTL_PG_VERSION: '18'
141141
KUTTL_POSTGIS_VERSION: '3.5'
142-
KUTTL_IVORY_IMAGE: 'docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1'
142+
KUTTL_IVORY_IMAGE: 'docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1'
143143
- run: |
144144
make check-kuttl && exit
145145
failed=$?

.golangci.next.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
# https://golangci-lint.run/usage/configuration/
2-
#
3-
# This file is for linters that might be interesting to enforce in the future.
4-
# Rules that should be enforced immediately belong in [.golangci.yaml].
5-
#
6-
# Both files are used by [.github/workflows/lint.yaml].
1+
version: "2"
72

83
linters:
94
disable-all: true
@@ -15,30 +10,33 @@ linters:
1510
- godox
1611
- goerr113
1712
- gofumpt
18-
- gosec # exclude-use-default
13+
- gosec
1914
- nilnil
2015
- nolintlint
2116
- predeclared
2217
- revive
23-
- staticcheck # exclude-use-default
18+
- staticcheck
2419
- tenv
2520
- thelper
2621
- tparallel
2722
- wastedassign
2823

2924
issues:
30-
# https://github.com/golangci/golangci-lint/issues/2239
3125
exclude-use-default: false
3226

3327
linters-settings:
3428
errchkjson:
3529
check-error-free-encoding: true
3630

3731
thelper:
38-
# https://github.com/kulti/thelper/issues/27
39-
tb: { begin: true, first: true }
40-
test: { begin: true, first: true, name: true }
32+
tb:
33+
begin: true
34+
first: true
35+
test:
36+
begin: true
37+
first: true
38+
name: true
4139

4240
run:
4341
build-tags:
44-
- envtest
42+
- envtest

.golangci.yaml

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,62 @@
1-
# https://golangci-lint.run/usage/configuration/
1+
version: "2"
22

33
linters:
44
disable:
55
- contextcheck
66
- errchkjson
7-
- gci
8-
- gofumpt
9-
- scopelint
107
enable:
118
- depguard
129
- gomodguard
13-
- gosimple
1410
- importas
1511
- misspell
1612
- unconvert
17-
presets:
18-
- bugs
19-
- format
20-
- unused
21-
22-
linters-settings:
23-
depguard:
24-
rules:
25-
everything:
26-
deny:
27-
- pkg: io/ioutil
28-
desc: >
29-
Use the "io" and "os" packages instead.
30-
See https://go.dev/doc/go1.16#ioutil
31-
32-
not-tests:
33-
files: ['!$test']
34-
deny:
35-
- pkg: net/http/httptest
36-
desc: Should be used only in tests.
37-
38-
- pkg: testing/*
39-
desc: The "testing" packages should be used only in tests.
40-
41-
- pkg: github.com/ivorysql/ivory-operator/internal/testing/*
42-
desc: The "internal/testing" packages should be used only in tests.
43-
44-
exhaustive:
45-
default-signifies-exhaustive: true
46-
47-
goimports:
48-
local-prefixes: github.com/ivorysql/ivory-operator
49-
50-
gomodguard:
51-
blocked:
52-
modules:
53-
- gopkg.in/yaml.v2: { recommendations: [sigs.k8s.io/yaml] }
54-
- gopkg.in/yaml.v3: { recommendations: [sigs.k8s.io/yaml] }
55-
- gotest.tools: { recommendations: [gotest.tools/v3] }
56-
- k8s.io/kubernetes:
57-
reason: >
58-
k8s.io/kubernetes is for managing dependencies of the Kubernetes
59-
project, i.e. building kubelet and kubeadm.
60-
61-
importas:
62-
alias:
63-
- pkg: k8s.io/api/(\w+)/(v[\w\w]+)
64-
alias: $1$2
65-
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
66-
alias: $1$2
67-
- pkg: k8s.io/apimachinery/pkg/api/errors
68-
alias: apierrors
69-
no-unaliased: true
13+
settings:
14+
dupword:
15+
ignore:
16+
# We might see duplicate instances of 'fi' if we end two bash 'if' statements
17+
- fi
18+
19+
depguard:
20+
rules:
21+
everything:
22+
deny:
23+
- pkg: io/ioutil
24+
desc: >
25+
Use the "io" and "os" packages instead.
26+
See https://go.dev/doc/go1.16#ioutil
27+
not-tests:
28+
files: ['!$test']
29+
deny:
30+
- pkg: net/http/httptest
31+
desc: Should be used only in tests.
32+
- pkg: testing/*
33+
desc: The "testing" packages should be used only in tests.
34+
- pkg: github.com/ivorysql/ivory-operator/internal/testing/*
35+
desc: The "internal/testing" packages should be used only in tests.
36+
37+
exhaustive:
38+
default-signifies-exhaustive: true
39+
40+
gomodguard:
41+
blocked:
42+
modules:
43+
- gopkg.in/yaml.v2: { recommendations: [sigs.k8s.io/yaml] }
44+
- gopkg.in/yaml.v3: { recommendations: [sigs.k8s.io/yaml] }
45+
- gotest.tools: { recommendations: [gotest.tools/v3] }
46+
- k8s.io/kubernetes:
47+
reason: >
48+
k8s.io/kubernetes is for managing dependencies of the Kubernetes project.
49+
50+
importas:
51+
alias:
52+
- pkg: k8s.io/api/(\w+)/(v[\w\w]+)
53+
alias: $1$2
54+
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
55+
alias: $1$2
56+
- pkg: k8s.io/apimachinery/pkg/api/errors
57+
alias: apierrors
58+
no-unaliased: true
7059

7160
run:
7261
build-tags:
73-
- envtest
74-
skip-dirs:
75-
- pkg/generated
62+
- envtest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ generate-kuttl: export KUTTL_PG_UPGRADE_FROM_VERSION ?= 14
206206
generate-kuttl: export KUTTL_PG_UPGRADE_TO_VERSION ?= 15
207207
generate-kuttl: export KUTTL_PG_VERSION ?= 15
208208
generate-kuttl: export KUTTL_POSTGIS_VERSION ?= 3.3
209-
generate-kuttl: export KUTTL_IVORY_IMAGE ?= docker.io/ivorysql/ivorysql:ubi8-2.2-1.1-1
209+
generate-kuttl: export KUTTL_IVORY_IMAGE ?= docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1
210210
generate-kuttl: ## Generate kuttl tests
211211
[ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
212212
[ ! -d testing/kuttl/e2e-generated-other ] || rm -r testing/kuttl/e2e-generated-other

config/manager/manager.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ spec:
1919
- name: IVORY_DEBUG
2020
value: "true"
2121
- name: RELATED_IMAGE_IVORY_18
22-
value: "docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1"
22+
value: "docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1"
2323
- name: RELATED_IMAGE_PGADMIN
24-
value: "docker.io/ivorysql/pgadmin:ubi8-9.9-5.0-1"
24+
value: "docker.io/ivorysql/pgadmin:ubi9-9.9-5.1-1"
2525
- name: RELATED_IMAGE_PGBACKREST
26-
value: "docker.io/ivorysql/pgbackrest:ubi8-2.56.0-5.0-1"
26+
value: "docker.io/ivorysql/pgbackrest:ubi9-2.56.0-5.1-1"
2727
- name: RELATED_IMAGE_PGBOUNCER
28-
value: "docker.io/ivorysql/pgbouncer:ubi8-1.23.0-5.0-1"
28+
value: "docker.io/ivorysql/pgbouncer:ubi9-1.24.0-5.1-1"
2929
- name: RELATED_IMAGE_PGEXPORTER
30-
value: "docker.io/ivorysql/postgres-exporter:ubi8-0.17.0-5.0-1"
30+
value: "docker.io/ivorysql/postgres-exporter:ubi9-0.17.0-5.1-1"
3131
- name: RELATED_IMAGE_PGUPGRADE
32-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi8-5.3.1-0"
32+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi9-5.3.1-0"
3333
- name: RELATED_IMAGE_POSTGRES_18_GIS_3.5
34-
value: "docker.io/ivorysql/ivorysql-postgis:ubi8-3.5-5.0-1"
34+
value: "docker.io/ivorysql/ivorysql-postgis:ubi9-3.5-5.1-1"
3535
securityContext:
3636
allowPrivilegeEscalation: false
3737
capabilities: { drop: [ALL] }

examples/ivorycluster/ivorycluster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: IvoryCluster
33
metadata:
44
name: hippo
55
spec:
6-
image: docker.io/ivorysql/ivorysql:ubi8-2.2-1.1-1
6+
image: docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1
77
postgresVersion: 15
88
instances:
99
- name: instance1
@@ -15,7 +15,7 @@ spec:
1515
storage: 1Gi
1616
backups:
1717
pgbackrest:
18-
image: docker.io/ivorysql/pgbackrest:ubi8-2.45-1.1-1
18+
image: docker.io/ivorysql/pgbackrest:ubi9-2.56.0-5.1-1
1919
repos:
2020
- name: repo1
2121
volume:

examples/kustomize/azure/ivory.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: IvoryCluster
33
metadata:
44
name: hippo-azure
55
spec:
6-
image: docker.io/ivorysql/ivorysql:ubi8-2.2-1.1-1
6+
image: docker.io/ivorysql/ivorysql:ubi9-5.1-5.1-1
77
postgresVersion: 15
88
instances:
99
- dataVolumeClaimSpec:
@@ -14,7 +14,7 @@ spec:
1414
storage: 1Gi
1515
backups:
1616
pgbackrest:
17-
image: docker.io/ivorysql/pgbackrest:ubi8-2.45-1.1-1
17+
image: docker.io/ivorysql/pgbackrest:ubi9-2.56.0-5.1-1
1818
configuration:
1919
- secret:
2020
name: ivyo-azure-creds

0 commit comments

Comments
 (0)