Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG baseImage="golang:1.24"
ARG baseImage="golang:1.26"
# Build the manager binary
FROM ${baseImage} as builder

Expand All @@ -18,7 +18,7 @@ RUN make

# Start obj-cache
# https://medium.com/windmill-engineering/tips-tricks-for-making-your-golang-container-builds-10x-faster-4cc618a43827
FROM golang:1.24 as obj-cache
FROM golang:1.26 as obj-cache
COPY --from=builder /root/.cache /root/.cache

# Use distroless as minimal base image to package the manager binary
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ BUILDDATE := $(shell date -Iseconds)
VERSION := $(or ${DOCKER_TAG},latest)
LOCALBIN ?= $(shell pwd)/bin
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.21.0

# Postgres operator variables for YAML download
POSTGRES_OPERATOR_VERSION ?= v1.15.1
POSTGRES_OPERATOR_VERSION ?= v2.0.2
POSTGRES_OPERATOR_URL ?= https://raw.githubusercontent.com/zalando/postgres-operator/$(POSTGRES_OPERATOR_VERSION)/manifests
POSTGRES_CRD_URL ?= https://raw.githubusercontent.com/zalando/postgres-operator/$(POSTGRES_OPERATOR_VERSION)/charts/postgres-operator/crds/postgresqls.yaml

Expand Down Expand Up @@ -142,6 +142,12 @@ svc-postgres-operator-yaml:
-f $(POSTGRES_OPERATOR_URL)/api-service.yaml \
--dry-run=client -o yaml > external/svc-postgres-operator.yaml

@# deep-merge every external/patches/*.yaml into the list item matching its kind and name
@for p in external/patches/*.yaml; do echo "patching with $$p"; PATCH=$$p yq -i \
'load(strenv(PATCH)) as $$p | (.items[] | select(.kind == $$p.kind and .metadata.name == $$p.metadata.name)) *=d $$p' \
external/svc-postgres-operator.yaml; done

yq -i '. head_comment="THIS FILE IS GENERATED by `make svc-postgres-operator-yaml`. DO NOT EDIT MANUALLY"' external/svc-postgres-operator.yaml
# crd-postgresql-yaml:
# kubectl apply -f $(POSTGRES_CRD_URL) --dry-run=client -o yaml > external/crd-postgresql.yaml

Expand Down
2 changes: 1 addition & 1 deletion api/v1/postgres_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"regexp"

firewall "github.com/metal-stack/firewall-controller/v2/api/v1"
zalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
zalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down
4 changes: 2 additions & 2 deletions controllers/postgres_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"time"

"github.com/go-logr/logr"
zalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
zalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -750,7 +750,7 @@ func (r *PostgresReconciler) getStandbyEnvs(ctx context.Context, p *pg.Postgres)
}
primaryS3url, err := url.Parse(primaryBackupConfig.S3Endpoint)
if err != nil {
r.recorder.Eventf(primary, "Warning", "Error", "error while parsing the s3 endpoint url in the backup secret: %w", err)
r.recorder.Eventf(primary, "Warning", "Error", "error while parsing the s3 endpoint url in the backup secret: %v", err)

return standbyEnvs
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/postgres_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
firewall "github.com/metal-stack/firewall-controller/v2/api/v1"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
zalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
zalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
)
Expand Down
2 changes: 1 addition & 1 deletion controllers/status_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/predicate"

zalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
zalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"

pg "github.com/fi-ts/postgreslet/api/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/fi-ts/postgreslet/pkg/lbmanager"
"github.com/fi-ts/postgreslet/pkg/operatormanager"
firewall "github.com/metal-stack/firewall-controller/v2/api/v1"
zalando "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
zalando "github.com/zalando/postgres-operator/v2/pkg/apis/acid.zalan.do/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
Expand Down
13 changes: 13 additions & 0 deletions external/patches/postgres-operator-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: Deployment
metadata:
name: postgres-operator
spec:
template:
spec:
containers:
- securityContext:
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
Loading
Loading