Skip to content

Commit d8171d3

Browse files
authored
Merge pull request #7 from CrunchyData/main
rebase
2 parents dc72665 + b50bae9 commit d8171d3

File tree

138 files changed

+8916
-987
lines changed

Some content is hidden

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

138 files changed

+8916
-987
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ jobs:
143143
--env 'RELATED_IMAGE_POSTGRES_17=registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-17.2-2' \
144144
--env 'RELATED_IMAGE_POSTGRES_17_GIS_3.4=registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-17.2-3.4-2' \
145145
--env 'RELATED_IMAGE_STANDALONE_PGADMIN=registry.developers.crunchydata.com/crunchydata/crunchy-pgadmin4:ubi8-8.14-1' \
146+
--env 'RELATED_IMAGE_COLLECTOR=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.119.0' \
146147
--env 'PGO_FEATURE_GATES=TablespaceVolumes=true' \
147148
--name 'postgres-operator' ubuntu \
148149
postgres-operator

.golangci.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ issues:
114114
path: internal/kubernetes/discovery.go
115115
text: k8s.io/client-go/discovery
116116

117-
# PGO-2010
118-
- linters: [exhaustive]
119-
path: internal/controller/postgrescluster/volumes.go
120-
text: 'v1.PersistentVolumeClaimConditionType: v1.PersistentVolumeClaimControllerResizeError, v1.PersistentVolumeClaimNodeResizeError$'
121-
122117
# These value types have unmarshal methods.
123118
# https://github.com/raeperd/recvcheck/issues/7
124119
- linters: [recvcheck]

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,16 @@ generate-kuttl: ## Generate kuttl tests
254254
##@ Generate
255255

256256
.PHONY: check-generate
257-
check-generate: ## Check crd, deepcopy functions, and rbac generation
258-
check-generate: generate-crd
259-
check-generate: generate-deepcopy
260-
check-generate: generate-rbac
257+
check-generate: ## Check everything generated is also committed
258+
check-generate: generate
261259
git diff --exit-code -- config/crd
262260
git diff --exit-code -- config/rbac
261+
git diff --exit-code -- internal/collector
263262
git diff --exit-code -- pkg/apis
264263

265264
.PHONY: generate
266-
generate: ## Generate crd, deepcopy functions, and rbac
265+
generate: ## Generate everything
266+
generate: generate-collector
267267
generate: generate-crd
268268
generate: generate-deepcopy
269269
generate: generate-rbac
@@ -276,6 +276,10 @@ generate-crd: tools/controller-gen
276276
paths='./pkg/apis/...' \
277277
output:dir='config/crd/bases' # {directory}/{group}_{plural}.yaml
278278

279+
.PHONY: generate-collector
280+
generate-collector: ## Generate OTel Collector files
281+
$(GO) generate ./internal/collector
282+
279283
.PHONY: generate-deepcopy
280284
generate-deepcopy: ## Generate DeepCopy functions
281285
generate-deepcopy: tools/controller-gen
@@ -304,7 +308,7 @@ endef
304308
CONTROLLER ?= hack/tools/controller-gen
305309
tools: tools/controller-gen
306310
tools/controller-gen:
307-
$(call go-get-tool,$(CONTROLLER),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5)
311+
$(call go-get-tool,$(CONTROLLER),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2)
308312

309313
ENVTEST ?= hack/tools/setup-envtest
310314
tools: tools/setup-envtest

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.5
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: crunchybridgeclusters.postgres-operator.crunchydata.com
88
spec:
99
group: postgres-operator.crunchydata.com

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

Lines changed: 462 additions & 23 deletions
Large diffs are not rendered by default.

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

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.5
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: pgupgrades.postgres-operator.crunchydata.com
88
spec:
99
group: postgres-operator.crunchydata.com
@@ -963,6 +963,7 @@ spec:
963963
type: object
964964
fromPostgresVersion:
965965
description: The major version of PostgreSQL before the upgrade.
966+
format: int32
966967
maximum: 17
967968
minimum: 11
968969
type: integer
@@ -984,7 +985,7 @@ spec:
984985
description: |-
985986
The image pull secrets used to pull from a private registry.
986987
Changing this value causes all running PGUpgrade pods to restart.
987-
https://k8s.io/docs/tasks/configure-pod-container/pull-image-private-registry/
988+
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry
988989
items:
989990
description: |-
990991
LocalObjectReference contains enough information to let you locate the
@@ -1002,6 +1003,13 @@ spec:
10021003
type: object
10031004
x-kubernetes-map-type: atomic
10041005
type: array
1006+
jobs:
1007+
description: |-
1008+
The number of simultaneous processes pg_upgrade should use.
1009+
More info: https://www.postgresql.org/docs/current/pgupgrade.html
1010+
format: int32
1011+
minimum: 0
1012+
type: integer
10051013
metadata:
10061014
description: Metadata contains metadata for custom resources
10071015
properties:
@@ -1015,14 +1023,14 @@ spec:
10151023
type: object
10161024
type: object
10171025
postgresClusterName:
1018-
description: The name of the cluster to be updated
1026+
description: The name of the Postgres cluster to upgrade.
10191027
minLength: 1
10201028
type: string
10211029
priorityClassName:
10221030
description: |-
10231031
Priority class name for the PGUpgrade pod. Changing this
10241032
value causes PGUpgrade pod to restart.
1025-
More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
1033+
More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption
10261034
type: string
10271035
resources:
10281036
description: Resource requirements for the PGUpgrade container.
@@ -1083,13 +1091,9 @@ spec:
10831091
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
10841092
type: object
10851093
type: object
1086-
toPostgresImage:
1087-
description: |-
1088-
The image name to use for PostgreSQL containers after upgrade.
1089-
When omitted, the value comes from an operator environment variable.
1090-
type: string
10911094
toPostgresVersion:
10921095
description: The major version of PostgreSQL to be upgraded to.
1096+
format: int32
10931097
maximum: 17
10941098
minimum: 11
10951099
type: integer
@@ -1134,11 +1138,30 @@ spec:
11341138
type: string
11351139
type: object
11361140
type: array
1141+
transferMethod:
1142+
description: |-
1143+
The method pg_upgrade should use to transfer files to the new cluster.
1144+
More info: https://www.postgresql.org/docs/current/pgupgrade.html
1145+
enum:
1146+
- Clone
1147+
- Copy
1148+
- CopyFileRange
1149+
- Link
1150+
maxLength: 15
1151+
type: string
11371152
required:
11381153
- fromPostgresVersion
11391154
- postgresClusterName
11401155
- toPostgresVersion
11411156
type: object
1157+
x-kubernetes-validations:
1158+
- rule: self.fromPostgresVersion < self.toPostgresVersion
1159+
- message: Only Copy or Link before PostgreSQL 12
1160+
rule: '!has(self.transferMethod) || (self.toPostgresVersion < 12 ? self.transferMethod
1161+
in ["Copy","Link"] : true)'
1162+
- message: Only Clone, Copy, or Link before PostgreSQL 17
1163+
rule: '!has(self.transferMethod) || (self.toPostgresVersion < 17 ? self.transferMethod
1164+
in ["Clone","Copy","Link"] : true)'
11421165
status:
11431166
description: PGUpgradeStatus defines the observed state of PGUpgrade
11441167
properties:

0 commit comments

Comments
 (0)