Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9627e7e
Remove Postgres 10 from APIs and Tests
tjmoore4 Oct 22, 2024
8c575a2
Remove major-upgrade-missing-image KUTTL test from e2e-other
tjmoore4 Oct 22, 2024
817f6b4
Remove json:omitempty from required fields
cbandy Oct 23, 2024
334c763
October updates to workflows and README
dsessler7 Oct 25, 2024
f5f68bb
run make generate
gkech Apr 2, 2025
b28ceba
Update field manager for deployment id / configmap (#4020)
benjaminjb Oct 29, 2024
7467825
Check that snapshot.Status is not nil when checking Status properties.
dsessler7 Oct 28, 2024
c1a014d
Move SQL escape functions to the Postgres package
cbandy Nov 4, 2024
5135203
Enable the "errchkjson" linter
cbandy Nov 4, 2024
859b3c8
Quiet a number of "gosec" warnings in tests
cbandy Nov 4, 2024
43186c7
Create warning event when postgres version is EOL.
dsessler7 Nov 5, 2024
a320ea7
Consistently use either pointer or value receivers
cbandy Nov 15, 2024
20adc74
fix errors and tests
gkech Apr 2, 2025
65ff108
Add functions to safely convert unstructured types
cbandy Nov 14, 2024
1fcabd2
fix library
gkech Apr 2, 2025
3acf77f
Run upgrade tests in isolated namespaces
cbandy Nov 13, 2024
dfde59d
fix test
cbandy Nov 14, 2024
567d9a1
Remove github.com/pkg/errors from tests
cbandy Nov 12, 2024
3b8362f
fix imports
gkech Apr 2, 2025
0716d4a
Load VolumeSnapshot CRDs from the client Go module during tests
cbandy Nov 15, 2024
a03eacd
fix issues
gkech Apr 2, 2025
b44d8e8
Add default container annotation (#4031)
benjaminjb Nov 20, 2024
09ea1d9
bring back GOBIN='/hack/tools', run make clean-deprecated
gkech Apr 2, 2025
7ecfef5
fix one more test
gkech Apr 2, 2025
dcdc887
commit generated
gkech Apr 2, 2025
bfba996
revert change on aws sdk go
gkech Apr 4, 2025
a1f99c9
Add an interface for querying available Kubernetes APIs
cbandy Aug 16, 2024
ae31415
conflicts fixing
gkech Apr 9, 2025
56a6c68
Explicitly enable "hot_standby" during restore
cbandy Nov 4, 2024
3c48007
Consider pg_ctl successful when progress is made
cbandy Nov 8, 2024
9d80a0b
Tidy the pgBackRest restore command using slices
cbandy Nov 4, 2024
4b53dd4
run make generate for main
gkech Apr 9, 2025
4a8e08c
features and conflicts and main
benjaminjb Dec 3, 2024
6ec48a2
Stop turning runners context.Canceled error into nil.
dsessler7 Dec 6, 2024
a0df8c6
Add a Comparison for YAML that contains a string
cbandy Dec 5, 2024
83a1100
remove k8s helper functions that are not used
gkech Apr 9, 2025
ffeb146
Use multiple processors when PGUpgrade is given CPU resources
cbandy Dec 4, 2024
e57f1d6
bring back the error on marshaling
gkech Apr 9, 2025
4a9e322
fix tests
gkech Apr 9, 2025
8986d9d
run go fmt
gkech Apr 10, 2025
0ea82d5
larget timeout on assert 01
gkech Apr 11, 2025
8b43a3d
add sts default annotation if version over 2.7
gkech Apr 11, 2025
b59a582
fix annotations for pgbouncer and pgbackrest
gkech Apr 11, 2025
7edaeb7
fix unit test internal/controller/postgrescluster/pgbouncer_test.go
gkech Apr 11, 2025
d7df180
run go fmt
gkech Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .golangci.next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ linters:
enable:
- contextcheck
- err113
- errchkjson
- gocritic
- godot
- godox
Expand All @@ -28,13 +27,16 @@ linters:
- wastedassign

issues:
exclude-rules:
# We call external linters when they are installed: Flake8, ShellCheck, etc.
- linters: [gosec]
path: '_test[.]go$'
text: 'G204: Subprocess launched with variable'

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

linters-settings:
errchkjson:
check-error-free-encoding: true

thelper:
# https://github.com/kulti/thelper/issues/27
tb: { begin: true, first: true }
Expand Down
20 changes: 16 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
linters:
disable:
- contextcheck
- errchkjson
- gci
- gofumpt
- goimports
Expand Down Expand Up @@ -47,6 +46,15 @@ linters-settings:
- pkg: github.com/percona/percona-postgresql-operator/internal/testing/*
desc: The "internal/testing" packages should be used only in tests.

tests:
files: ['$test']
deny:
- pkg: github.com/pkg/errors
desc: Use the "errors" package unless you are interacting with stack traces.

errchkjson:
check-error-free-encoding: true

exhaustive:
default-signifies-exhaustive: true

Expand All @@ -73,6 +81,10 @@ run:
build-tags:
- envtest
issues:
exclude-dirs:
- pkg/generated
- hack
exclude-generated: strict
exclude-rules:
# These value types have unmarshal methods.
# https://github.com/raeperd/recvcheck/issues/7
- linters: [recvcheck]
path: internal/pki/pki.go
text: 'methods of "(Certificate|PrivateKey)"'
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ PGMONITOR_DIR ?= hack/tools/pgmonitor
PGMONITOR_VERSION ?= v4.11.0
QUERIES_CONFIG_DIR ?= hack/tools/queries

EXTERNAL_SNAPSHOTTER_DIR ?= hack/tools/external-snapshotter
EXTERNAL_SNAPSHOTTER_VERSION ?= v8.0.1

# Buildah's "build" used to be "bud". Use the alias to be compatible for a while.
BUILDAH_BUILD ?= buildah bud

Expand Down Expand Up @@ -56,12 +53,6 @@ get-pgmonitor:
cp -r '$(PGMONITOR_DIR)/postgres_exporter/common/.' '${QUERIES_CONFIG_DIR}'
cp '$(PGMONITOR_DIR)/postgres_exporter/linux/queries_backrest.yml' '${QUERIES_CONFIG_DIR}'

.PHONY: get-external-snapshotter
get-external-snapshotter:
git -C '$(dir $(EXTERNAL_SNAPSHOTTER_DIR))' clone https://github.com/kubernetes-csi/external-snapshotter.git || git -C '$(EXTERNAL_SNAPSHOTTER_DIR)' fetch origin
@git -C '$(EXTERNAL_SNAPSHOTTER_DIR)' checkout '$(EXTERNAL_SNAPSHOTTER_VERSION)'
@git -C '$(EXTERNAL_SNAPSHOTTER_DIR)' config pull.ff only

.PHONY: clean
clean: ## Clean resources
clean: clean-deprecated
Expand Down Expand Up @@ -209,7 +200,7 @@ check: get-pgmonitor
check-envtest: ## Run check using envtest and a mock kube api
check-envtest: ENVTEST_USE = hack/tools/setup-envtest --bin-dir=$(CURDIR)/hack/tools/envtest use $(ENVTEST_K8S_VERSION)
check-envtest: SHELL = bash
check-envtest: get-pgmonitor get-external-snapshotter
check-envtest: get-pgmonitor tools/setup-envtest
GOBIN='$(CURDIR)/hack/tools' $(GO) install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
@$(ENVTEST_USE) --print=overview && echo
source <($(ENVTEST_USE) --print=env) && PGO_NAMESPACE="postgres-operator" QUERIES_CONFIG_DIR="$(CURDIR)/${QUERIES_CONFIG_DIR}" \
Expand All @@ -221,7 +212,7 @@ check-envtest: get-pgmonitor get-external-snapshotter
# make check-envtest-existing PGO_TEST_TIMEOUT_SCALE=1.2
.PHONY: check-envtest-existing
check-envtest-existing: ## Run check using envtest and an existing kube api
check-envtest-existing: get-pgmonitor get-external-snapshotter
check-envtest-existing: get-pgmonitor
check-envtest-existing: createnamespaces
kubectl apply --server-side -k ./config/dev
USE_EXISTING_CLUSTER=true PGO_NAMESPACE="postgres-operator" QUERIES_CONFIG_DIR="$(CURDIR)/${QUERIES_CONFIG_DIR}" \
Expand Down
2,703 changes: 0 additions & 2,703 deletions build/crd/crunchy/generated/postgres-operator.crunchydata.com_pgupgrades.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20829,10 +20829,6 @@ spec:
type:
description: The pgBackRest backup type for this Job
type: string
required:
- cronJobName
- repo
- type
type: object
type: array
type: object
Expand Down
7 changes: 6 additions & 1 deletion cmd/postgres-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ func main() {
assertNoError(err)

assertNoError(features.Set(os.Getenv("PGO_FEATURE_GATES")))
log.Info("feature gates enabled", "PGO_FEATURE_GATES", features.String())
ctx = feature.NewContext(ctx, features)
log.Info("feature gates",
// These are set by the user
"PGO_FEATURE_GATES", feature.ShowAssigned(ctx),
// These are enabled, including features that are on by default
"enabled", feature.ShowEnabled(ctx))

cruntime.SetLogger(log)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20727,10 +20727,6 @@ spec:
type:
description: The pgBackRest backup type for this Job
type: string
required:
- cronJobName
- repo
- type
type: object
type: array
type: object
Expand Down
22 changes: 11 additions & 11 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ spec:
fieldPath: metadata.namespace
- name: CRUNCHY_DEBUG
value: "true"
- name: RELATED_IMAGE_POSTGRES_15
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.7-1"
- name: RELATED_IMAGE_POSTGRES_15_GIS_3.3
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-15.7-3.3-1"
- name: RELATED_IMAGE_POSTGRES_16
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.4-2"
- name: RELATED_IMAGE_POSTGRES_16_GIS_3.3
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.3-3.3-1"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.4-3.3-2"
- name: RELATED_IMAGE_POSTGRES_16_GIS_3.4
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.3-3.4-1"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.4-3.4-2"
- name: RELATED_IMAGE_POSTGRES_17
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.0-0"
- name: RELATED_IMAGE_POSTGRES_17_GIS_3.4
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.0-3.4-0"
- name: RELATED_IMAGE_PGADMIN
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-26"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-31"
- name: RELATED_IMAGE_PGBACKREST
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.51-1"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.53.1-0"
- name: RELATED_IMAGE_PGBOUNCER
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.22-1"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-0"
- name: RELATED_IMAGE_PGEXPORTER
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:latest"
- name: RELATED_IMAGE_PGUPGRADE
value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:latest"
- name: RELATED_IMAGE_STANDALONE_PGADMIN
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.6-1"
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.12-0"
securityContext:
allowPrivilegeEscalation: false
capabilities: { drop: [ALL] }
Expand Down
4 changes: 0 additions & 4 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47215,10 +47215,6 @@ spec:
type:
description: The pgBackRest backup type for this Job
type: string
required:
- cronJobName
- repo
- type
type: object
type: array
type: object
Expand Down
4 changes: 0 additions & 4 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47215,10 +47215,6 @@ spec:
type:
description: The pgBackRest backup type for this Job
type: string
required:
- cronJobName
- repo
- type
type: object
type: array
type: object
Expand Down
4 changes: 0 additions & 4 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47215,10 +47215,6 @@ spec:
type:
description: The pgBackRest backup type for this Job
type: string
required:
- cronJobName
- repo
- type
type: object
type: array
type: object
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/tests/upgrade-consistency/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 180
timeout: 300
---
kind: StatefulSet
apiVersion: apps/v1
Expand Down
5 changes: 1 addition & 4 deletions examples/postgrescluster/postgrescluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: PostgresCluster
metadata:
name: hippo
spec:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1
postgresVersion: 16
instances:
- name: instance1
Expand All @@ -15,7 +14,6 @@ spec:
storage: 1Gi
backups:
pgbackrest:
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.51-1
repos:
- name: repo1
volume:
Expand All @@ -34,5 +32,4 @@ spec:
requests:
storage: 1Gi
proxy:
pgBouncer:
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.22-1
pgBouncer: {}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ require (
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
golang.org/x/mod v0.24.0 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
)

Expand Down Expand Up @@ -122,7 +123,7 @@ require (
golang.org/x/term v0.31.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/tools v0.31.0 // indirect
golang.org/x/tools v0.31.0
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250311190419-81fb87f6b8bf // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
Loading
Loading