Skip to content

Commit 6522a66

Browse files
authored
Merge branch 'main' into K8SPG-732
2 parents 0f43cb0 + a794a94 commit 6522a66

115 files changed

Lines changed: 1522 additions & 3804 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.

.golangci.next.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ linters:
1010
enable:
1111
- contextcheck
1212
- err113
13-
- errchkjson
1413
- gocritic
1514
- godot
1615
- godox
@@ -28,13 +27,16 @@ linters:
2827
- wastedassign
2928

3029
issues:
30+
exclude-rules:
31+
# We call external linters when they are installed: Flake8, ShellCheck, etc.
32+
- linters: [gosec]
33+
path: '_test[.]go$'
34+
text: 'G204: Subprocess launched with variable'
35+
3136
# https://github.com/golangci/golangci-lint/issues/2239
3237
exclude-use-default: false
3338

3439
linters-settings:
35-
errchkjson:
36-
check-error-free-encoding: true
37-
3840
thelper:
3941
# https://github.com/kulti/thelper/issues/27
4042
tb: { begin: true, first: true }

.golangci.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
linters:
44
disable:
55
- contextcheck
6-
- errchkjson
76
- gci
87
- gofumpt
98
- goimports
@@ -47,6 +46,15 @@ linters-settings:
4746
- pkg: github.com/percona/percona-postgresql-operator/internal/testing/*
4847
desc: The "internal/testing" packages should be used only in tests.
4948

49+
tests:
50+
files: ['$test']
51+
deny:
52+
- pkg: github.com/pkg/errors
53+
desc: Use the "errors" package unless you are interacting with stack traces.
54+
55+
errchkjson:
56+
check-error-free-encoding: true
57+
5058
exhaustive:
5159
default-signifies-exhaustive: true
5260

@@ -73,6 +81,10 @@ run:
7381
build-tags:
7482
- envtest
7583
issues:
76-
exclude-dirs:
77-
- pkg/generated
78-
- hack
84+
exclude-generated: strict
85+
exclude-rules:
86+
# These value types have unmarshal methods.
87+
# https://github.com/raeperd/recvcheck/issues/7
88+
- linters: [recvcheck]
89+
path: internal/pki/pki.go
90+
text: 'methods of "(Certificate|PrivateKey)"'

Makefile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ PGMONITOR_DIR ?= hack/tools/pgmonitor
99
PGMONITOR_VERSION ?= v4.11.0
1010
QUERIES_CONFIG_DIR ?= hack/tools/queries
1111

12-
EXTERNAL_SNAPSHOTTER_DIR ?= hack/tools/external-snapshotter
13-
EXTERNAL_SNAPSHOTTER_VERSION ?= v8.0.1
14-
1512
# Buildah's "build" used to be "bud". Use the alias to be compatible for a while.
1613
BUILDAH_BUILD ?= buildah bud
1714

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

59-
.PHONY: get-external-snapshotter
60-
get-external-snapshotter:
61-
git -C '$(dir $(EXTERNAL_SNAPSHOTTER_DIR))' clone https://github.com/kubernetes-csi/external-snapshotter.git || git -C '$(EXTERNAL_SNAPSHOTTER_DIR)' fetch origin
62-
@git -C '$(EXTERNAL_SNAPSHOTTER_DIR)' checkout '$(EXTERNAL_SNAPSHOTTER_VERSION)'
63-
@git -C '$(EXTERNAL_SNAPSHOTTER_DIR)' config pull.ff only
64-
6556
.PHONY: clean
6657
clean: ## Clean resources
6758
clean: clean-deprecated
@@ -209,7 +200,7 @@ check: get-pgmonitor
209200
check-envtest: ## Run check using envtest and a mock kube api
210201
check-envtest: ENVTEST_USE = hack/tools/setup-envtest --bin-dir=$(CURDIR)/hack/tools/envtest use $(ENVTEST_K8S_VERSION)
211202
check-envtest: SHELL = bash
212-
check-envtest: get-pgmonitor get-external-snapshotter
203+
check-envtest: get-pgmonitor tools/setup-envtest
213204
GOBIN='$(CURDIR)/hack/tools' $(GO) install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
214205
@$(ENVTEST_USE) --print=overview && echo
215206
source <($(ENVTEST_USE) --print=env) && PGO_NAMESPACE="postgres-operator" QUERIES_CONFIG_DIR="$(CURDIR)/${QUERIES_CONFIG_DIR}" \
@@ -221,7 +212,7 @@ check-envtest: get-pgmonitor get-external-snapshotter
221212
# make check-envtest-existing PGO_TEST_TIMEOUT_SCALE=1.2
222213
.PHONY: check-envtest-existing
223214
check-envtest-existing: ## Run check using envtest and an existing kube api
224-
check-envtest-existing: get-pgmonitor get-external-snapshotter
215+
check-envtest-existing: get-pgmonitor
225216
check-envtest-existing: createnamespaces
226217
kubectl apply --server-side -k ./config/dev
227218
USE_EXISTING_CLUSTER=true PGO_NAMESPACE="postgres-operator" QUERIES_CONFIG_DIR="$(CURDIR)/${QUERIES_CONFIG_DIR}" \

build/crd/crunchy/generated/postgres-operator.crunchydata.com_pgupgrades.yaml

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

build/crd/crunchy/generated/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20451,6 +20451,10 @@ spec:
2045120451
type: string
2045220452
type: array
2045320453
x-kubernetes-list-type: set
20454+
grantPublicSchemaAccess:
20455+
description: Grant the user access to the public schema in each
20456+
database listed under `databases`.
20457+
type: boolean
2045420458
name:
2045520459
description: |-
2045620460
The name of this PostgreSQL user. The value may contain only lowercase
@@ -20829,10 +20833,6 @@ spec:
2082920833
type:
2083020834
description: The pgBackRest backup type for this Job
2083120835
type: string
20832-
required:
20833-
- cronJobName
20834-
- repo
20835-
- type
2083620836
type: object
2083720837
type: array
2083820838
type: object

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ spec:
5858
properties:
5959
autoCreateUserSchema:
6060
description: |-
61-
Whether or not the cluster has schemas automatically created for the user
62-
defined in `spec.users` for all of the databases listed for that user.
61+
Indicates whether schemas are automatically created for the user
62+
specified in `spec.users` across all databases associated with that user.
6363
type: boolean
6464
backups:
6565
description: PostgreSQL backup configuration
@@ -18252,6 +18252,10 @@ spec:
1825218252
type: string
1825318253
type: array
1825418254
x-kubernetes-list-type: set
18255+
grantPublicSchemaAccess:
18256+
description: Grant the user access to the public schema in each
18257+
database listed under `databases`.
18258+
type: boolean
1825518259
name:
1825618260
description: |-
1825718261
The name of this PostgreSQL user. The value may contain only lowercase
@@ -18303,6 +18307,11 @@ spec:
1830318307
- instances
1830418308
- postgresVersion
1830518309
type: object
18310+
x-kubernetes-validations:
18311+
- message: PostgresVersion must be >= 15 if grantPublicSchemaAccess exists
18312+
and is true
18313+
rule: '!has(self.users) || self.postgresVersion >= 15 || self.users.all(u,
18314+
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1830618315
status:
1830718316
properties:
1830818317
host:

cmd/postgres-operator/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ func main() {
9292
assertNoError(err)
9393

9494
assertNoError(features.Set(os.Getenv("PGO_FEATURE_GATES")))
95-
log.Info("feature gates enabled", "PGO_FEATURE_GATES", features.String())
95+
ctx = feature.NewContext(ctx, features)
96+
log.Info("feature gates",
97+
// These are set by the user
98+
"PGO_FEATURE_GATES", feature.ShowAssigned(ctx),
99+
// These are enabled, including features that are on by default
100+
"enabled", feature.ShowEnabled(ctx))
96101

97102
cruntime.SetLogger(log)
98103

config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ spec:
463463
properties:
464464
autoCreateUserSchema:
465465
description: |-
466-
Whether or not the cluster has schemas automatically created for the user
467-
defined in `spec.users` for all of the databases listed for that user.
466+
Indicates whether schemas are automatically created for the user
467+
specified in `spec.users` across all databases associated with that user.
468468
type: boolean
469469
backups:
470470
description: PostgreSQL backup configuration
@@ -18657,6 +18657,10 @@ spec:
1865718657
type: string
1865818658
type: array
1865918659
x-kubernetes-list-type: set
18660+
grantPublicSchemaAccess:
18661+
description: Grant the user access to the public schema in each
18662+
database listed under `databases`.
18663+
type: boolean
1866018664
name:
1866118665
description: |-
1866218666
The name of this PostgreSQL user. The value may contain only lowercase
@@ -18708,6 +18712,11 @@ spec:
1870818712
- instances
1870918713
- postgresVersion
1871018714
type: object
18715+
x-kubernetes-validations:
18716+
- message: PostgresVersion must be >= 15 if grantPublicSchemaAccess exists
18717+
and is true
18718+
rule: '!has(self.users) || self.postgresVersion >= 15 || self.users.all(u,
18719+
!has(u.grantPublicSchemaAccess) || !u.grantPublicSchemaAccess)'
1871118720
status:
1871218721
properties:
1871318722
host:

config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20349,6 +20349,10 @@ spec:
2034920349
type: string
2035020350
type: array
2035120351
x-kubernetes-list-type: set
20352+
grantPublicSchemaAccess:
20353+
description: Grant the user access to the public schema in each
20354+
database listed under `databases`.
20355+
type: boolean
2035220356
name:
2035320357
description: |-
2035420358
The name of this PostgreSQL user. The value may contain only lowercase
@@ -20727,10 +20731,6 @@ spec:
2072720731
type:
2072820732
description: The pgBackRest backup type for this Job
2072920733
type: string
20730-
required:
20731-
- cronJobName
20732-
- repo
20733-
- type
2073420734
type: object
2073520735
type: array
2073620736
type: object

config/manager/manager.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,28 @@ spec:
1818
fieldPath: metadata.namespace
1919
- name: CRUNCHY_DEBUG
2020
value: "true"
21-
- name: RELATED_IMAGE_POSTGRES_15
22-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.7-1"
23-
- name: RELATED_IMAGE_POSTGRES_15_GIS_3.3
24-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-15.7-3.3-1"
2521
- name: RELATED_IMAGE_POSTGRES_16
26-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1"
22+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.4-2"
2723
- name: RELATED_IMAGE_POSTGRES_16_GIS_3.3
28-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.3-3.3-1"
24+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.4-3.3-2"
2925
- name: RELATED_IMAGE_POSTGRES_16_GIS_3.4
30-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.3-3.4-1"
26+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.4-3.4-2"
27+
- name: RELATED_IMAGE_POSTGRES_17
28+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.0-0"
29+
- name: RELATED_IMAGE_POSTGRES_17_GIS_3.4
30+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.0-3.4-0"
3131
- name: RELATED_IMAGE_PGADMIN
32-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-26"
32+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-4.30-31"
3333
- name: RELATED_IMAGE_PGBACKREST
34-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.51-1"
34+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.53.1-0"
3535
- name: RELATED_IMAGE_PGBOUNCER
36-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.22-1"
36+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.23-0"
3737
- name: RELATED_IMAGE_PGEXPORTER
3838
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:latest"
3939
- name: RELATED_IMAGE_PGUPGRADE
4040
value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:latest"
4141
- name: RELATED_IMAGE_STANDALONE_PGADMIN
42-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.6-1"
42+
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.12-0"
4343
securityContext:
4444
allowPrivilegeEscalation: false
4545
capabilities: { drop: [ALL] }

0 commit comments

Comments
 (0)