Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7f9450b
added spec.issuerConf to CRD
mayankshah1607 Jul 13, 2026
187c2f8
wip
mayankshah1607 Jul 14, 2026
482d0c3
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 15, 2026
e347f11
cleanup
mayankshah1607 Jul 15, 2026
6e5dcbd
use issuer name for secret name
mayankshah1607 Jul 15, 2026
abe1790
trim down unnecessary comments
mayankshah1607 Jul 15, 2026
9d97033
improve ResolveIssuerMode by checking labels
mayankshah1607 Jul 15, 2026
8c941e7
add groupName in issuerRef
mayankshah1607 Jul 15, 2026
a19b878
remove unnecessary test
mayankshah1607 Jul 15, 2026
c7f2e5b
updated cr.yaml
mayankshah1607 Jul 15, 2026
f544698
remove unnecessarily verbose comments
mayankshah1607 Jul 15, 2026
cbf3959
update e2e test
mayankshah1607 Jul 15, 2026
d123e94
linting
mayankshah1607 Jul 15, 2026
4e0ff68
Potential fix for pull request finding
mayankshah1607 Jul 15, 2026
63b3e41
fix scheme ordering
mayankshah1607 Jul 16, 2026
491a4d0
unit test fix
mayankshah1607 Jul 16, 2026
bedf9c4
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 16, 2026
42ca64e
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 17, 2026
f2dc250
fix panic
mayankshah1607 Jul 17, 2026
ec13aa1
e2e test fixes
mayankshah1607 Jul 17, 2026
8ce02eb
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 17, 2026
5edf149
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 21, 2026
f304d27
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 23, 2026
1112177
remove ticket references
mayankshah1607 Jul 23, 2026
d779006
Merge branch 'main' into K8SPG-951-issuer-conf
mayankshah1607 Jul 24, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -28734,6 +28734,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down
16 changes: 7 additions & 9 deletions cmd/postgres-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,6 @@ func main() {
)
assertNoError(err)

// Add Percona custom resource types to scheme
assertNoError(v2.AddToScheme(mgr.GetScheme()))

assertNoError(volumesnapshotv1.AddToScheme(mgr.GetScheme()))

// K8SPG-552
// Add Scheme for cert-manager resources like Issuer and Certificate.
assertNoError(certmanagerscheme.AddToScheme(mgr.GetScheme()))

// add all PostgreSQL Operator controllers to the runtime manager
err = addControllersToManager(ctx, mgr)
assertNoError(err)
Expand Down Expand Up @@ -367,6 +358,13 @@ func initManager(ctx context.Context) (runtime.Options, error) {
}
}

// add scheme
scheme := runtime.Scheme
assertNoError(v2.AddToScheme(scheme))
assertNoError(volumesnapshotv1.AddToScheme(scheme))
assertNoError(certmanagerscheme.AddToScheme(scheme))
options.Scheme = scheme

return options, nil
}

Expand Down
6 changes: 6 additions & 0 deletions cmd/postgres-operator/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (

"gotest.tools/v3/assert"
"gotest.tools/v3/assert/cmp"

"github.com/percona/percona-postgresql-operator/v2/internal/controller/runtime"
)

func TestInitManager(t *testing.T) {
Expand Down Expand Up @@ -42,6 +44,9 @@ func TestInitManager(t *testing.T) {
assert.Assert(t, options.RenewDeadline.Seconds() == 40)
assert.Assert(t, options.RetryPeriod.Seconds() == 10)

assert.Assert(t, options.Scheme == runtime.Scheme,
"expected the shared scheme to be configured before manager creation")

{
options.Cache.SyncPeriod = nil
options.Controller.GroupKindConcurrency = nil
Expand All @@ -51,6 +56,7 @@ func TestInitManager(t *testing.T) {
options.LeaseDuration = nil
options.RenewDeadline = nil
options.RetryPeriod = nil
options.Scheme = nil

assert.Assert(t, reflect.ValueOf(options).IsZero(),
"expected remaining fields to be unset:\n%+v", options)
Expand Down
20 changes: 20 additions & 0 deletions config/crd/bases/pgv2.percona.com_perconapgclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29432,6 +29432,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28709,6 +28709,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down
40 changes: 40 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29729,6 +29729,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down Expand Up @@ -66826,6 +66846,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down
4 changes: 4 additions & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ spec:
# certValidityDuration: 2160h
# caValidityDuration: 26280h
# pgBackRestCertValidityDuration: 2160h
# issuerConf:
# name: some-selfsigned-issuer
# kind: ClusterIssuer
# group: cert-manager.io
# standby:
# enabled: true
# host: "<primary-ip>"
Expand Down
40 changes: 40 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29729,6 +29729,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down Expand Up @@ -66826,6 +66846,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down
40 changes: 40 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29729,6 +29729,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down Expand Up @@ -66826,6 +66846,26 @@ spec:
type: string
certValidityDuration:
type: string
issuerConf:
description: IssuerReference is a reference to a certificate issuer
object with a given name, kind and group.
properties:
group:
description: |-
Group of the issuer being referred to.
Defaults to 'cert-manager.io'.
type: string
kind:
description: |-
Kind of the issuer being referred to.
Defaults to 'Issuer'.
type: string
name:
description: Name of the issuer being referred to.
type: string
required:
- name
type: object
pgBackRestCertValidityDuration:
type: string
type: object
Expand Down
5 changes: 5 additions & 0 deletions e2e-tests/functions
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,11 @@ deploy_cert_manager() {
sleep 5
done

echo "Waiting for cert-manager mutating webhook to be ready..."
until kubectl get mutatingwebhookconfiguration cert-manager-webhook -o jsonpath='{.webhooks[0].clientConfig.caBundle}' | grep -q '[A-Za-z0-9+/=]'; do
sleep 5
done

echo "Waiting for cert-manager webhook service to have endpoints..."
until kubectl -n cert-manager get endpoints cert-manager-webhook -o jsonpath='{.subsets[*].addresses}' | grep -q '.'; do
sleep 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ commands:
kubectl -n "$NAMESPACE" delete pod -l postgres-operator.crunchydata.com/role=pgbouncer,postgres-operator.crunchydata.com/cluster=cert-manager-tls

wait_cluster_consistency cert-manager-tls
timeout: 120
timeout: 240
Loading
Loading