Skip to content

Commit e0148ea

Browse files
authored
Merge branch 'main' into K8SPG-778
2 parents caff9a3 + 9703907 commit e0148ea

File tree

97 files changed

+3576
-242
lines changed

Some content is hidden

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

97 files changed

+3576
-242
lines changed

Makefile

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,36 @@ release-postgres-operator-image-labels:
369369
##@ Percona
370370

371371
# Default values if not already set
372+
ifeq (undefined,$(origin REGISTRY_NAME))
373+
$(info REGISTRY_NAME is not set)
374+
else ifeq (undefined,$(origin IMAGE))
375+
$(info IMAGE is not set)
376+
else
377+
IMAGE := $(REGISTRY_NAME)/$(IMAGE)
378+
$(info Combined IMAGE: $(IMAGE))
379+
endif
380+
372381
NAME ?= percona-postgresql-operator
373382
VERSION ?= $(shell git rev-parse --abbrev-ref HEAD | sed -e 's^/^-^g; s^[.]^-^g;' | tr '[:upper:]' '[:lower:]')
374383
ROOT_REPO ?= ${PWD}
375384
IMAGE_TAG_BASE ?= perconalab/$(NAME)
376385
IMAGE ?= $(IMAGE_TAG_BASE):$(VERSION)
377386
PGO_VERSION ?= $(shell git describe --tags)
387+
REGISTRY_NAME ?= docker.io
388+
REGISTRY_NAME_FULL = $(REGISTRY_NAME)/
389+
390+
generate:
391+
ifneq (,$(filter percona/% perconalab/%,$(IMAGE)))
392+
ifeq (,$(findstring docker.io/,$(IMAGE)))
393+
IMAGE := $(REGISTRY_NAME_FULL)$(IMAGE)
394+
$(info Updated IMAGE to: $(IMAGE))
395+
else
396+
$(info IMAGE already qualified: $(IMAGE))
397+
endif
398+
else
399+
$(info Skipping: IMAGE does not match percona/perconalab)
400+
endif
401+
$(info $(IMAGE))
378402

379403
KUSTOMIZE = $(shell pwd)/bin/kustomize
380404
kustomize: ## Download kustomize locally if necessary.
@@ -425,33 +449,40 @@ include e2e-tests/release_versions
425449
release: generate
426450
$(SED) -i \
427451
-e "/^spec:/,/^ crVersion:/{s/crVersion: .*/crVersion: $(VERSION)/}" \
428-
-e "/^spec:/,/^ image:/{s#image: .*#image: $(IMAGE_POSTGRESQL16)#}" \
429-
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: $(IMAGE_PGBOUNCER16)#}" \
430-
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: $(IMAGE_PGBACKREST16)#}" \
431-
-e "/extensions:/,/image:/{s#image: .*#image: $(IMAGE_OPERATOR)#}" \
432-
-e "/^ pmm:/,/^ image:/{s#image: .*#image: $(IMAGE_PMM_CLIENT)#}" deploy/cr.yaml
452+
-e "/^spec:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_POSTGRESQL17)#}" \
453+
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_PGBOUNCER17)#}" \
454+
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_BACKREST17)#}" \
455+
-e "/extensions:/,/image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_OPERATOR)#}" \
456+
-e "/^ pmm:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_PMM3_CLIENT)#}" deploy/cr.yaml
433457
$(SED) -i -r "/Version *= \"[0-9]+\.[0-9]+\.[0-9]+\"$$/ s/[0-9]+\.[0-9]+\.[0-9]+/$(VERSION)/" pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go
434458
$(SED) -i \
435-
-e "/^spec:/,/^ image:/{s#image: .*#image: $(IMAGE_OPERATOR)#}" \
436-
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: $(IMAGE_POSTGRESQL16)#}" \
437-
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: $(IMAGE_PGBOUNCER16)#}" \
438-
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: $(IMAGE_PGBACKREST16)#}" deploy/upgrade.yaml
459+
-e "/^spec:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)$(IMAGE_UPGRADE)#}" \
460+
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: $(REGISTRY_NAME_FULL)$(IMAGE_POSTGRESQL17)#}" \
461+
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: $(REGISTRY_NAME_FULL)$(IMAGE_PGBOUNCER17)#}" \
462+
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: $(REGISTRY_NAME_FULL)$(IMAGE_BACKREST17)#}" deploy/upgrade.yaml
439463

440464
# Prepare main branch after release
441-
MAJOR_VER := $(shell grep -oE "crVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+\.[0-9]+\.[0-9]+"|cut -d'.' -f1)
442-
MINOR_VER := $(shell grep -oE "crVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+\.[0-9]+\.[0-9]+"|cut -d'.' -f2)
443-
NEXT_VER ?= $(MAJOR_VER).$$(($(MINOR_VER) + 1)).0
465+
CURRENT_VERSION := $(shell grep -oE "crVersion: [0-9]+\.[0-9]+\.[0-9]+" deploy/cr.yaml | grep -oE "[0-9]+\.[0-9]+\.[0-9]+")
466+
MAJOR_VER := $(word 1,$(subst ., ,$(CURRENT_VERSION)))
467+
MINOR_VER := $(word 2,$(subst ., ,$(CURRENT_VERSION)))
468+
NEXT_VER := $(MAJOR_VER).$(shell expr $(MINOR_VER) + 1).0
469+
PREV1_VERSION := $(MAJOR_VER).$(shell expr $(MINOR_VER) - 1).0
470+
PREV2_VERSION := $(MAJOR_VER).$(shell expr $(MINOR_VER) - 2).0
444471
after-release: generate
472+
echo $(NEXT_VER) > percona/version/version.txt
445473
$(SED) -i \
446474
-e "/^spec:/,/^ crVersion:/{s/crVersion: .*/crVersion: $(NEXT_VER)/}" \
447-
-e "/^spec:/,/^ image:/{s#image: .*#image: perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-postgres#}" \
448-
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-pgbouncer#}" \
449-
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-pgbackrest#}" \
450-
-e "/extensions:/,/image:/{s#image: .*#image: perconalab/percona-postgresql-operator:main#}" \
451-
-e "/^ pmm:/,/^ image:/{s#image: .*#image: perconalab/pmm-client:dev-latest#}" deploy/cr.yaml
475+
-e "/^spec:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-postgres#}" \
476+
-e "/^ pgBouncer:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbouncer$(PG_VER)#}" \
477+
-e "/^ pgbackrest:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbackrest$(PG_VER)#}" \
478+
-e "/extensions:/,/image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main#}" \
479+
-e "/^ pmm:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/pmm-client:dev-latest#}" deploy/cr.yaml percona/controller/testdata/sidecar-resources-cr.yaml
452480
$(SED) -i -r "/Version *= \"[0-9]+\.[0-9]+\.[0-9]+\"$$/ s/[0-9]+\.[0-9]+\.[0-9]+/$(NEXT_VER)/" pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go
453481
$(SED) -i \
454-
-e "/^spec:/,/^ image:/{s#image: .*#image: perconalab/percona-postgresql-operator:main#}" \
455-
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-postgres#}" \
456-
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-pgbouncer#}" \
457-
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-pgbackrest#}" deploy/upgrade.yaml
482+
-e "/^spec:/,/^ image:/{s#image: .*#image: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-upgrade#}" \
483+
-e "/^spec:/,/^ toPostgresImage:/{s#toPostgresImage: .*#toPostgresImage: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-ppg$(PG_VER)-postgres#}" \
484+
-e "/^spec:/,/^ toPgBouncerImage:/{s#toPgBouncerImage: .*#toPgBouncerImage: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbouncer$(PG_VER)#}" \
485+
-e "/^spec:/,/^ toPgBackRestImage:/{s#toPgBackRestImage: .*#toPgBackRestImage: $(REGISTRY_NAME_FULL)perconalab/percona-postgresql-operator:main-pgbackrest$(PG_VER)#}" deploy/upgrade.yaml
486+
$(SED) -i "s/$(PREV2_VERSION)/$(PREV1_VERSION)/g" e2e-tests/tests/upgrade-consistency/01-*.yaml
487+
$(SED) -i "s/$(PREV1_VERSION)/$(CURRENT_VERSION)/g" e2e-tests/tests/upgrade-consistency/02-*.yaml
488+
$(SED) -i "s/$(CURRENT_VERSION)/$(NEXT_VER)/g" e2e-tests/tests/upgrade-consistency/03-*.yaml e2e-tests/tests/init-deploy/05-assert.yaml

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

Lines changed: 223 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8340,8 +8340,12 @@ spec:
83408340
properties:
83418341
bucket:
83428342
type: string
8343+
disableSSL:
8344+
type: string
83438345
endpoint:
83448346
type: string
8347+
forcePathStyle:
8348+
type: string
83458349
region:
83468350
type: string
83478351
secret:
@@ -18372,8 +18376,225 @@ spec:
1837218376
observedGeneration:
1837318377
format: int64
1837418378
type: integer
18375-
patroniVersion:
18376-
type: string
18379+
patroni:
18380+
properties:
18381+
status:
18382+
properties:
18383+
switchover:
18384+
description: Tracks the execution of the switchover requests.
18385+
type: string
18386+
switchoverTimeline:
18387+
description: Tracks the current timeline during switchovers
18388+
format: int64
18389+
type: integer
18390+
systemIdentifier:
18391+
description: The PostgreSQL system identifier reported by
18392+
Patroni.
18393+
type: string
18394+
type: object
18395+
version:
18396+
type: string
18397+
type: object
18398+
pgbackrest:
18399+
description: Status information for pgBackRest
18400+
properties:
18401+
manualBackup:
18402+
description: Status information for manual backups
18403+
properties:
18404+
active:
18405+
description: The number of actively running manual backup
18406+
Pods.
18407+
format: int32
18408+
type: integer
18409+
completionTime:
18410+
description: |-
18411+
Represents the time the manual backup Job was determined by the Job controller
18412+
to be completed. This field is only set if the backup completed successfully.
18413+
Additionally, it is represented in RFC3339 form and is in UTC.
18414+
format: date-time
18415+
type: string
18416+
failed:
18417+
description: The number of Pods for the manual backup Job
18418+
that reached the "Failed" phase.
18419+
format: int32
18420+
type: integer
18421+
finished:
18422+
description: |-
18423+
Specifies whether or not the Job is finished executing (does not indicate success or
18424+
failure).
18425+
type: boolean
18426+
id:
18427+
description: |-
18428+
A unique identifier for the manual backup as provided using the "pgbackrest-backup"
18429+
annotation when initiating a backup.
18430+
type: string
18431+
startTime:
18432+
description: |-
18433+
Represents the time the manual backup Job was acknowledged by the Job controller.
18434+
It is represented in RFC3339 form and is in UTC.
18435+
format: date-time
18436+
type: string
18437+
succeeded:
18438+
description: The number of Pods for the manual backup Job
18439+
that reached the "Succeeded" phase.
18440+
format: int32
18441+
type: integer
18442+
required:
18443+
- finished
18444+
- id
18445+
type: object
18446+
repoHost:
18447+
description: Status information for the pgBackRest dedicated repository
18448+
host
18449+
properties:
18450+
apiVersion:
18451+
description: |-
18452+
APIVersion defines the versioned schema of this representation of an object.
18453+
Servers should convert recognized schemas to the latest internal value, and
18454+
may reject unrecognized values.
18455+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
18456+
type: string
18457+
kind:
18458+
description: |-
18459+
Kind is a string value representing the REST resource this object represents.
18460+
Servers may infer this from the endpoint the client submits requests to.
18461+
Cannot be updated.
18462+
In CamelCase.
18463+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
18464+
type: string
18465+
ready:
18466+
description: Whether or not the pgBackRest repository host
18467+
is ready for use
18468+
type: boolean
18469+
type: object
18470+
repos:
18471+
description: Status information for pgBackRest repositories
18472+
items:
18473+
description: RepoStatus the status of a pgBackRest repository
18474+
properties:
18475+
bound:
18476+
description: Whether or not the pgBackRest repository PersistentVolumeClaim
18477+
is bound to a volume
18478+
type: boolean
18479+
name:
18480+
description: The name of the pgBackRest repository
18481+
type: string
18482+
replicaCreateBackupComplete:
18483+
description: |-
18484+
ReplicaCreateBackupReady indicates whether a backup exists in the repository as needed
18485+
to bootstrap replicas.
18486+
type: boolean
18487+
repoOptionsHash:
18488+
description: |-
18489+
A hash of the required fields in the spec for defining an Azure, GCS or S3 repository,
18490+
Utilized to detect changes to these fields and then execute pgBackRest stanza-create
18491+
commands accordingly.
18492+
type: string
18493+
stanzaCreated:
18494+
description: Specifies whether or not a stanza has been
18495+
successfully created for the repository
18496+
type: boolean
18497+
volume:
18498+
description: The name of the volume the containing the pgBackRest
18499+
repository
18500+
type: string
18501+
required:
18502+
- name
18503+
type: object
18504+
type: array
18505+
x-kubernetes-list-map-keys:
18506+
- name
18507+
x-kubernetes-list-type: map
18508+
restore:
18509+
description: Status information for in-place restores
18510+
properties:
18511+
active:
18512+
description: The number of actively running manual backup
18513+
Pods.
18514+
format: int32
18515+
type: integer
18516+
completionTime:
18517+
description: |-
18518+
Represents the time the manual backup Job was determined by the Job controller
18519+
to be completed. This field is only set if the backup completed successfully.
18520+
Additionally, it is represented in RFC3339 form and is in UTC.
18521+
format: date-time
18522+
type: string
18523+
failed:
18524+
description: The number of Pods for the manual backup Job
18525+
that reached the "Failed" phase.
18526+
format: int32
18527+
type: integer
18528+
finished:
18529+
description: |-
18530+
Specifies whether or not the Job is finished executing (does not indicate success or
18531+
failure).
18532+
type: boolean
18533+
id:
18534+
description: |-
18535+
A unique identifier for the manual backup as provided using the "pgbackrest-backup"
18536+
annotation when initiating a backup.
18537+
type: string
18538+
startTime:
18539+
description: |-
18540+
Represents the time the manual backup Job was acknowledged by the Job controller.
18541+
It is represented in RFC3339 form and is in UTC.
18542+
format: date-time
18543+
type: string
18544+
succeeded:
18545+
description: The number of Pods for the manual backup Job
18546+
that reached the "Succeeded" phase.
18547+
format: int32
18548+
type: integer
18549+
required:
18550+
- finished
18551+
- id
18552+
type: object
18553+
scheduledBackups:
18554+
description: Status information for scheduled backups
18555+
items:
18556+
properties:
18557+
active:
18558+
description: The number of actively running manual backup
18559+
Pods.
18560+
format: int32
18561+
type: integer
18562+
completionTime:
18563+
description: |-
18564+
Represents the time the manual backup Job was determined by the Job controller
18565+
to be completed. This field is only set if the backup completed successfully.
18566+
Additionally, it is represented in RFC3339 form and is in UTC.
18567+
format: date-time
18568+
type: string
18569+
cronJobName:
18570+
description: The name of the associated pgBackRest scheduled
18571+
backup CronJob
18572+
type: string
18573+
failed:
18574+
description: The number of Pods for the manual backup Job
18575+
that reached the "Failed" phase.
18576+
format: int32
18577+
type: integer
18578+
repo:
18579+
description: The name of the associated pgBackRest repository
18580+
type: string
18581+
startTime:
18582+
description: |-
18583+
Represents the time the manual backup Job was acknowledged by the Job controller.
18584+
It is represented in RFC3339 form and is in UTC.
18585+
format: date-time
18586+
type: string
18587+
succeeded:
18588+
description: The number of Pods for the manual backup Job
18589+
that reached the "Succeeded" phase.
18590+
format: int32
18591+
type: integer
18592+
type:
18593+
description: The pgBackRest backup type for this Job
18594+
type: string
18595+
type: object
18596+
type: array
18597+
type: object
1837718598
pgbouncer:
1837818599
properties:
1837918600
ready:

0 commit comments

Comments
 (0)