Skip to content

Commit 105659d

Browse files
committed
Resolve conflicts
2 parents e037408 + a9b6c52 commit 105659d

63 files changed

Lines changed: 10205 additions & 980 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.

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ gzip-charts:
3535
gzip -f -c ./charts/patroni-services/monitoring/cloudsql-grafana-dashboard.json > ./charts/patroni-services/monitoring/cloudsql-grafana-dashboard.json.gz
3636
gzip -f -c ./charts/patroni-services/monitoring/postgres-exporter-grafana-dashboard.json > ./charts/patroni-services/monitoring/postgres-exporter-grafana-dashboard.json.gz
3737
gzip -f -c ./charts/patroni-services/monitoring/query-exporter-grafana-dashboard.json > ./charts/patroni-services/monitoring/query-exporter-grafana-dashboard.json.gz
38+
gzip -f -c ./charts/patroni-services/monitoring/pgbackrest-exporter-grafana-dashboard.json > ./charts/patroni-services/monitoring/pgbackrest-exporter-grafana-dashboard.json.gz
3839

3940
move-charts:
4041
@echo "Move helm charts"
@@ -83,7 +84,7 @@ ifeq (, $(shell which controller-gen))
8384
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
8485
cd $$CONTROLLER_GEN_TMP_DIR ;\
8586
go mod init tmp ;\
86-
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.3 ;\
87+
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.19.0 ;\
8788
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
8889
}
8990
CONTROLLER_GEN=$(GOBIN)/controller-gen

api/apps/v1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Package v1 contains API Schema definitions for the v1 API group
1616
// +kubebuilder:object:generate=true
17-
// +groupName=qubership.org
17+
// +groupName=netcracker.com
1818
package v1
1919

2020
import (
@@ -24,7 +24,7 @@ import (
2424

2525
var (
2626
// GroupVersion is group version used to register these objects
27-
GroupVersion = schema.GroupVersion{Group: "qubership.org", Version: "v1"}
27+
GroupVersion = schema.GroupVersion{Group: "netcracker.com", Version: "v1"}
2828

2929
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3030
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

api/apps/v1/postgresservice_types.go

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ type PatroniServicesSpec struct {
4141
QueryExporter QueryExporter `json:"queryExporter,omitempty"`
4242
Tls *Tls `json:"tls,omitempty"`
4343
PgBackRest *PgBackRest `json:"pgBackRest,omitempty"`
44+
PgBackRestExporter *PgBackRestExporter `json:"pgBackRestExporter,omitempty"`
4445
InstallationTimestamp string `json:"installationTimestamp,omitempty"`
4546
PrivateRegistry PrivateRegistry `json:"privateRegistry,omitempty"`
47+
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
4648
}
4749

4850
type PrivateRegistry struct {
@@ -232,16 +234,20 @@ type Tls struct {
232234
}
233235

234236
type PgBackRest struct {
235-
DockerImage string `json:"dockerImage,omitempty"`
236-
RepoType string `json:"repoType,omitempty"`
237-
RepoPath string `json:"repoPath,omitempty"`
238-
DiffSchedule string `json:"diffSchedule,omitempty"`
239-
IncrSchedule string `json:"incrSchedule,omitempty"`
240-
S3 S3 `json:"s3,omitempty"`
241-
Rwx *types.Storage `json:"rwx,omitempty"`
242-
BackupFromStandby bool `json:"backupFromStandby,omitempty"`
237+
DiffSchedule string `json:"diffSchedule,omitempty"`
238+
IncrSchedule string `json:"incrSchedule,omitempty"`
239+
BackupFromStandby bool `json:"backupFromStandby,omitempty"`
243240
}
244241

242+
type PgBackRestExporter struct {
243+
Install bool `json:"install,omitempty"`
244+
Image string `json:"image,omitempty"`
245+
Resources v1.ResourceRequirements `json:"resources,omitempty"`
246+
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
247+
Affinity v1.Affinity `json:"affinity,omitempty"`
248+
PodLabels map[string]string `json:"podLabels,omitempty"`
249+
Env map[string]string `json:"env,omitempty"`
250+
}
245251
type S3 struct {
246252
Bucket string `json:"bucket,omitempty"`
247253
Endpoint string `json:"endpoint,omitempty"`

api/apps/v1/zz_generated.deepcopy.go

Lines changed: 41 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/patroni/v1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Package v1 contains API Schema definitions for the v1 API group
1616
// +kubebuilder:object:generate=true
17-
// +groupName=qubership.org
17+
// +groupName=netcracker.com
1818
package v1
1919

2020
import (
@@ -24,7 +24,7 @@ import (
2424

2525
var (
2626
// GroupVersion is group version used to register these objects
27-
GroupVersion = schema.GroupVersion{Group: "qubership.org", Version: "v1"}
27+
GroupVersion = schema.GroupVersion{Group: "netcracker.com", Version: "v1"}
2828

2929
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3030
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

api/patroni/v1/patronicore_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type PatroniCoreSpec struct {
3535
Ldap *LdapConfig `json:"ldap,omitempty"`
3636
InstallationTimestamp string `json:"installationTimestamp,omitempty"`
3737
PrivateRegistry PrivateRegistry `json:"privateRegistry,omitempty"`
38+
ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"`
3839
}
3940

4041
type PrivateRegistry struct {
@@ -109,6 +110,7 @@ type Patroni struct {
109110
External *External `json:"external,omitempty"`
110111
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
111112
ConfigMapAnnotations map[string]string `json:"configMapAnnotations,omitempty"`
113+
PatroniResourcesLimitMemory string `json:"patroniResourcesLimitMemory,omitempty"`
112114
}
113115

114116
type External struct {
@@ -208,6 +210,7 @@ type PgBackRest struct {
208210
DiffSchedule string `json:"diffSchedule,omitempty"`
209211
IncrSchedule string `json:"incrSchedule,omitempty"`
210212
S3 S3 `json:"s3,omitempty"`
213+
DRS3 S3 `json:"drS3,omitempty"`
211214
Rwx *types.Storage `json:"rwx,omitempty"`
212215
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
213216
FullRetention int `json:"fullRetention,omitempty"`

api/patroni/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder
1+
FROM --platform=$BUILDPLATFORM golang:1.25-alpine3.22 AS builder
22

33
WORKDIR /workspace
44

@@ -16,7 +16,7 @@ ARG TARGETOS TARGETARCH
1616
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o ./build/_output/bin/postgres-operator \
1717
-gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} ./cmd/pgskipper-operator
1818

19-
FROM alpine:3.20.3
19+
FROM alpine:3.22
2020

2121
ENV OPERATOR=/usr/local/bin/postgres-operator \
2222
USER_UID=1001 \

build/configs/postgresql/postgresql_prepare.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,16 @@ BEGIN
8888
CREATE TEMPORARY TABLE pg_patroni_service_slot_cleaner_passwd_output (tt_id serial PRIMARY KEY NOT NULL, command_output text );
8989
COPY pg_patroni_service_slot_cleaner_passwd_output (command_output) FROM PROGRAM 'strings /proc/1/environ | sed -n "s/^PG_ROOT_PASSWORD=\(.*\)/\1/p"';
9090

91-
-- get current wal_keep_segments value and determine allowed_slot_delay
91+
-- get current wal_keep_size value and determine allowed_slot_delay
9292
IF ud_allowed_slot_delay < 0 THEN
93-
SELECT INTO allowed_slot_delay setting FROM pg_settings where name='wal_keep_segments';
93+
SELECT setting::integer INTO allowed_slot_delay FROM pg_settings where name='wal_keep_size';
9494
ELSE
9595
allowed_slot_delay = ud_allowed_slot_delay;
9696
END IF;
9797

9898
-- check if we have pg_xlog_location_diff or not (postgresql 9.6 vs postgresql 10)
9999
select into use_old_cmp_function exists(select * from pg_proc where proname = 'pg_xlog_location_diff');
100100

101-
--todo[anin] 16Mb size per WAL file is used. Honest calculation should get value from pg_settings
102-
allowed_slot_delay := allowed_slot_delay * 16 ;
103101
RAISE NOTICE 'allowed_slot_delay: % Mb', allowed_slot_delay;
104102

105103
-- perform slot cleanup for each active replica

0 commit comments

Comments
 (0)