Commit Graph

1460 Commits

Author SHA1 Message Date
thoro 101b63b63b
Merge 0affa9425a into b97de5d7f1 2026-01-19 14:56:52 +00:00
Polina Bungina b97de5d7f1
Standby section improvements (#3033)
- Allow standby_host to be specified together with wal_path
- Add standby_primary_slot_name
2026-01-19 13:54:27 +01:00
Mikkel Oscar Lyderik Larsen ad9ae4ec1b
Fix linting issues in delivery.yaml (#3032)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2026-01-16 17:56:06 +01:00
Mikkel Oscar Lyderik Larsen 32d6d0a7a7
Fix serving CRD at runtime (#3031)
* Fix serving CRD at runtime

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Correctly string quote version enum

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

---------

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2026-01-13 17:23:56 +01:00
Felix Kunde 97115d6e3d
add annotation to ignore resources thresholds (#3030)
* add annotation to ignore resources thresholds
* add test case when annotation key is set but value is not true
2026-01-13 09:33:24 +01:00
Mikkel Oscar Lyderik Larsen a585b17796
Generate postgresql CRD from go structs (#3007)
* Sort postgresql.crd.yaml
* Generate postgresql CRD from go structs
* Expand sidecars, env and initcontainers
* Embed CRD to be submitted by the operator

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

---------

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2026-01-12 17:33:28 +01:00
Mikkel Oscar Lyderik Larsen 0a44252534
Generate CRD for postgresteam resource (#3004)
* Sort postgresteam.crd.yaml

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Generate CRD for postgresteam resource

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

---------

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-01-10 19:39:08 +01:00
dependabot[bot] c331fd9434
Bump werkzeug from 3.1.4 to 3.1.5 in /ui (#3028)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.1.4...3.1.5)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-version: 3.1.5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-10 09:22:44 +01:00
Mikkel Oscar Lyderik Larsen 55cc167fca
Regenerate code for 2026 header (#3029)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2026-01-09 15:38:16 +01:00
Mikkel Oscar Lyderik Larsen f6839f87b9
Modernize code generation (#3003)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2026-01-09 14:22:10 +01:00
Ida Novindasari a06f8d796b
Do not promote operator image when merge to master (#3018) 2025-12-19 09:53:38 +01:00
Felix Kunde 1f4ee605ae
fix docker build for UI and bumped some outdated versions in docs and config (#3017)
* fix docker build for UI and bumped some outdated versions in docs and config
* update helm chart image again because of wrong format field
* switch to new registry ghcr.io for e2e test
* update e2e test runner Dockerfile
2025-12-18 12:12:53 +01:00
Felix Kunde c4f10ceadc
bump to v1.15.1 (#3011)
* bump to v1.15.1
2025-12-16 19:25:12 +01:00
Thomas Rosenstein 0affa9425a Improve sync responsiveness with background execution and context cancellation
This change improves the responsiveness of the operator when handling
deletion requests by running sync operations in the background and
using context cancellation to interrupt stuck operations.

Changes:
- Add context field to Cluster struct, passed through New()
- Add Cancel() method to cancel cluster's context
- Add StartSync/EndSync/NeedsResync for managing background sync state
- Run Sync() in a background goroutine so worker can process other events
- Add context-aware DB connection methods (initDbConnWithContext)
- Add RetryWithContext() that respects context cancellation
- Cancel cluster context immediately when DeletionTimestamp detected
- Use context-aware connections in syncRoles/syncDatabases
- StartSync/NeedsResync check context cancellation to prevent new syncs
  during deletion (no need for separate deleted flag)

Flow:
1. Sync event spawns background goroutine and returns immediately
2. If another sync arrives while one is running, needsResync flag is set
3. When sync completes, it checks needsResync and requeues if needed
4. Delete cancels context -> stuck DB operations return early -> mutex released
5. StartSync/NeedsResync return false when context cancelled
6. Delete proceeds without waiting for slow/stuck sync operations
2025-12-14 20:43:53 +00:00
Thomas Rosenstein 9ca87d9db4 Fix deletion timestamp handling for clusters with finalizers
When a Postgres cluster has a finalizer, deleting it sets a DeletionTimestamp
but doesn't remove the object until the finalizer is cleared. The operator
was not properly handling these DeletionTimestamp changes:

1. postgresqlUpdate() was filtering out events where only DeletionTimestamp
   changed (it only checked Spec and Annotations), causing the delete to
   never be processed.

2. EventUpdate case in processEvent() didn't check for DeletionTimestamp,
   so even if the event reached the processor, it would run Update() instead
   of Delete().

3. removeFinalizer() used a cached object with stale resourceVersion,
   causing "object has been modified" errors.

Fixes:
- Add explicit DeletionTimestamp check in postgresqlUpdate() to queue the event
- Add DeletionTimestamp check in EventUpdate to call Delete() when set
- Fetch latest object from API before removing finalizer to avoid conflicts
2025-12-14 20:29:01 +01:00
Ida Novindasari a27727f8d0
[ui] internal pipeline fix to build ui image (#3013)
* fix ui pipeline
* adjust logical backup image tagging
2025-12-12 16:49:58 +01:00
Steven Berler cd05682482
fix switchover schedule tests (#2995)
* fix switchover schedule tests

Previously the tests would fail depending on the local time zone and the
time of day the test was being run.

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Co-authored-by: Mikkel Oscar Lyderik Larsen <mikkeloscar@users.noreply.github.com>
2025-12-11 10:22:40 +01:00
Felix Kunde 5aa8f961ec
only trigger ghcr build on tag event (#3010) 2025-12-10 17:11:53 +01:00
dependabot[bot] fe340cb429
Bump golang.org/x/oauth2 from 0.23.0 to 0.27.0 in /kubectl-pg (#3008)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.23.0 to 0.27.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.23.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.27.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 17:11:22 +01:00
dependabot[bot] 543acd5731
Bump werkzeug from 3.0.6 to 3.1.4 in /ui (#3001)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.6 to 3.1.4.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.0.6...3.1.4)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-version: 3.1.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 17:08:01 +01:00
dependabot[bot] f826f75769
Bump golang.org/x/crypto from 0.43.0 to 0.45.0 (#2997)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.43.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.43.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 17:07:20 +01:00
Ida Novindasari 1b4ffb0875
Separate pipeline for internal/external build and support multi arch (#2991)
* separate pipeline for internal/external build and support multi arch
* remove distutils and use node:lts-alpine in both
* change base image arguments
* fix local naming and base image
* address feedback

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-12-10 16:45:42 +01:00
dependabot[bot] 842c6eded3
Bump golang.org/x/crypto from 0.31.0 to 0.45.0 in /kubectl-pg (#2996)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.31.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.31.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-12-10 15:34:42 +01:00
dependabot[bot] 88d6192064
Bump js-yaml from 4.1.0 to 4.1.1 in /ui/app (#2989)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-12-10 15:31:10 +01:00
Felix Kunde 04ad66f701
stop retention user cleanup early again when DB connection attempt fails (#2999)
* stop retention user cleanup early again when DB connection attempt fails
* add unit test and new returned error from updateSecret
2025-12-10 10:01:07 +01:00
ovnozdrach 42bbead4c9
Fix Sidecar without image specification issue (#2977)
Co-authored-by: Oleg Nozdrachev <ovnozdrach@mts.ru>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-12-09 09:37:11 +01:00
Aleksandr Vinokurov 744372b09b
Fix typo in README.md regarding bootstrap phase (#2978)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-12-09 09:36:32 +01:00
Felix Kunde 8e629c5d6d
add Mikkel (#3002) 2025-12-03 11:00:59 +01:00
Felix Kunde 2c57498e43
skip db user actions when its secret failed to sync on update (#2969)
* skip db user actions when its secret failed to sync on update
* need to add new pgUser field to e2e test
* lets collect errors of syncSecret so we still get status updateFailed
2025-11-05 16:28:37 +01:00
Felix Kunde 1af4c50ed0
bump to v1.15.0 (#2965)
* bump to v1.15.0
* more linter hints
* update dependencies of kubectl-pg plugin
2025-10-21 11:56:33 +02:00
Felix Kunde 3bc244fe39
bump dependencies and reflect linter suggestions (#2963) 2025-10-16 10:23:36 +02:00
Remi Rampin 8c2a290a12
DOC: Minikube has many drivers now, incl. Docker (#2949)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-10-14 13:50:11 +02:00
Remi Rampin 3a85466cfd
DOC: Fix formatting of bullet points (#2948)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-10-14 13:49:06 +02:00
Eng Zer Jun eddf521227
Replace `golang.org/x/exp` with stdlib (#2857)
* Replace `golang.org/x/exp` with stdlib

These experimental packages are now available in the Go standard
library since Go 1.21.

	1. golang.org/x/exp/slices -> slices [1]
	2. golang.org/x/exp/maps -> maps [2]

[1]: https://go.dev/doc/go1.21#slices
[2]: https://go.dev/doc/go1.21#maps

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* Run go mod tidy

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-10-14 11:59:48 +02:00
Felix Kunde 8ba57b28f5
extend RBAC in prepatation to switch to configmap-based cluster management (#2961) 2025-10-14 10:59:43 +02:00
Felix Kunde dc29425969
include external traffic policy comparison into service diffing (#2956) 2025-09-23 14:30:06 +02:00
Polina Bungina bcd729b2cc
Add selector to master service when switching to CM (#2955)
Add service selector comparison to compareServices
This is necessary for the proper switch of `kubernetes_use_configmaps` configuration value, as master service should have different label selector setup for those.
2025-09-19 14:44:17 +02:00
Alexander Gramovich d98fc2753a
logical-backup:gcs_upload: try to use gcp metadata if LOGICAL_GOOGLE_APPLICATION_CREDENTIALS is not set (#2837)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-09-17 16:01:28 +02:00
dependabot[bot] cce2633192
Bump requests from 2.32.2 to 2.32.4 in /ui (#2922)
Bumps [requests](https://github.com/psf/requests) from 2.32.2 to 2.32.4.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.2...v2.32.4)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-17 16:01:02 +02:00
Morten Lied Johansen ad7e590916
Skip creation of OwnerReference if user is in a different namespace (#2912)
Instead of doing a string compare on the username, check the actual namespace of the user to determine if an owner reference can be created.
2025-09-17 15:57:36 +02:00
Jociele Padilha fa4bc21538
upgrade Go from 1.23.4 to 1.25.0 (#2945)
* upgrade go to 1.25
* add minor version to be Go 1.25.0
* revert the Go version on README to keep the history of the release
2025-08-19 14:40:39 +02:00
Mario Trangoni 51135b07db
docs: Fix issues found by codespell (#2896)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-06-03 17:34:05 +02:00
Ida Novindasari ccb52c094d
[UI] Remove deprecated WAL-E library and enable WAL-G backup support in UI backend (#2915) 2025-05-20 16:31:26 +02:00
Polina Bungina 68c4b49636
Fix wrong condition for bootstrap labels (#2875) 2025-03-10 17:05:27 +01:00
Polina Bungina c7a586d0f8
Configure (upcoming) Patroni bootstrap labels feature (#2872)
Set the value from the critical-operation-pdb's selector if PDBs are enabled
2025-03-10 10:16:01 +01:00
Felix Kunde 746df0d33d
do not remove publications of slot defined in manifest (#2868)
* do not remove publications of slot defined in manifest
* improve condition to sync streams
* init publication tables map when adding manifest slots
* need to update c.Stream when there is no update
2025-02-26 17:31:37 +01:00
Felix Kunde 2a4be1cb39
fix creating secrets for rotation users (#2863)
* fix creating secrets for rotation users
* rework annotation comparison on update to decide on when to call syncSecrets
2025-02-14 09:44:09 +01:00
Polina Bungina c8063eb78a
Protect Pods from disruptions during upgrades (#2844)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2025-01-30 10:41:58 +01:00
Polina Bungina a56ecaace7
Critical operation PDB (#2830)
Create the second PDB to cover Pods with a special "critical operation" label set.

This label is going to be assigned to all pg cluster's Pods by the Operator during a PG major version upgrade, by Patroni during a cluster/replica bootstrap. It can also be set manually or by any other automation tool.
2025-01-29 12:41:08 +01:00
Polina Bungina f49b4f1e97
Ensure podAnnotations are removed from pods if reset in the config (#2826) 2025-01-24 16:53:14 +01:00