Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4d61408
feat: pgaccess
jhrv Sep 17, 2026
7faef84
fix: add reason
jhrv Sep 17, 2026
ff4b3d6
refactor(postgres): address personal access review comments
jhrv Sep 17, 2026
9ddc6f0
fix review comments
jhrv Sep 17, 2026
8da0ee7
fix: specify usage on different pg access commands
jhrv Sep 18, 2026
8d30c01
fix stuff based on feedback
jhrv Sep 18, 2026
bb6bcbe
Align Postgres API with Postgres and PostgresInstance CRDs
jhrv Sep 29, 2026
f889bfa
Align Postgres access GraphQL with API conventions and resolve main c…
jhrv Sep 29, 2026
060cae6
Consolidate PostgresAccess integration fixtures and add access level
jhrv Sep 29, 2026
7a057c3
Merge origin/main into pgaccess
jhrv Sep 29, 2026
8775a90
Fix Postgres integration test expectations
jhrv Sep 29, 2026
8556f4e
Limit Postgres GraphQL descriptions to changed API and fix validation…
jhrv Sep 29, 2026
4bb168c
leave old grantpgaccess for now
jhrv Sep 29, 2026
82c4d76
fixes
jhrv Sep 29, 2026
0e65a43
Preserve Zalando Postgres enum and assign Nais Postgres a distinct value
jhrv Sep 29, 2026
ab4a76d
Use one PostgresAccess GVR for reads and creation
jhrv Sep 29, 2026
bcf6ee1
Resolve personal Postgres connections from PostgresAccess status
jhrv Sep 29, 2026
2901eec
instances -> branches
jhrv Sep 29, 2026
4d37b2d
fix: build PostgresBranch API against published pgrator module
jhrv Sep 29, 2026
9a6f4b5
Scope Postgres branches under Postgres with local branch names
jhrv Oct 1, 2026
080ae36
test: update label selector Postgres expectations for local branch names
jhrv Oct 1, 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
51 changes: 51 additions & 0 deletions charts/console-backend-rbac/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,28 @@ rules:
- update
- patch
- delete
- apiGroups:
- "nais.io"
resources:
- postgresaccesses
verbs:
- get
- create
- apiGroups:
- "nais.io"
resources:
- postgresbranches
verbs:
- get
- list
- watch
- delete
- apiGroups:
- postgresql.cnpg.io
resources:
- clusters
verbs:
- get
- apiGroups:
- "aiven.nais.io"
resources:
Expand Down Expand Up @@ -265,14 +287,43 @@ rules:
- get
- list
- watch
- apiGroups:
- "nais.io"
resources:
- postgres
verbs:
- get
- list
- watch
# Legacy CLI port-forward grants still validate the old Zalando cluster.
- apiGroups:
- "data.nais.io"
resources:
- postgres
verbs:
- get
- apiGroups:
- "nais.io"
resources:
- postgresaccesses
verbs:
- get
- create
- apiGroups:
- "nais.io"
resources:
- postgresbranches
verbs:
- get
- list
- watch
- delete
- apiGroups:
- postgresql.cnpg.io
resources:
- clusters
verbs:
- get
- apiGroups:
- ""
resources:
Expand Down
29 changes: 21 additions & 8 deletions data/k8s/dev/devteam/postgres.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
apiVersion: data.nais.io/v1
---
apiVersion: nais.io/v1
kind: Postgres
metadata:
name: postgres-1
namespace: devteam
spec:
majorVersion: "18"
status:
activeBranch: postgres-1
---
apiVersion: nais.io/v1
kind: PostgresBranch
metadata:
name: postgres-1
namespace: devteam
labels:
key: value
team: devteam
spec:
cluster:
allowDeletion: false
majorVersion: "18"
resources:
diskSize: "2Gi"
cpu: "100m"
memory: "1Gi"
postgres: postgres-1
status:
reconcilePhase: Completed
conditions:
- type: cluster.postgresql.cnpg.io/ObservedState
status: "True"
reason: Reconciled
message: "Cluster is in phase: Cluster in healthy state"
lastTransitionTime: "2026-09-17T00:00:00Z"
85 changes: 46 additions & 39 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,31 @@ require (
github.com/lestrrat-go/jwx/v3 v3.0.1
github.com/nais/api/pkg/apiclient v0.0.0-20250219111538-2b76a0fd6ed9
github.com/nais/bifrost v0.0.0-20260106105449-911627ac2c61
github.com/nais/liberator v0.0.0-20260216142648-ee49a9372bc4
github.com/nais/pgrator/pkg/api v0.0.0-20260915202302-d699a2823ec5
github.com/nais/liberator v0.0.0-20260903194126-706ea87ddf9a
github.com/nais/pgrator/pkg/api v0.0.0-20261001051319-3ab0adfbd6ce
github.com/nais/tester v0.2.0
github.com/nais/unleasherator v0.0.0-20251216221129-efebc54203fe
github.com/nais/v13s/pkg/api v0.0.0-20260826091953-1b518b13ca28
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pressly/goose/v3 v3.27.0
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/common v0.67.5
github.com/prometheus/client_golang v1.24.0
github.com/prometheus/common v0.70.0
github.com/prometheus/prometheus v0.312.0
github.com/ravilushqa/otelgqlgen v0.19.0
github.com/robfig/cron/v3 v3.0.1
github.com/rs/cors v1.11.1
github.com/sethvargo/go-envconfig v1.3.0
github.com/sirupsen/logrus v1.9.4
github.com/sirupsen/logrus v1.10.2
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8
github.com/stretchr/testify v1.11.1
github.com/stretchr/testify v1.12.1
github.com/testcontainers/testcontainers-go v0.35.0
github.com/testcontainers/testcontainers-go/modules/postgres v0.35.0
github.com/vektah/gqlparser/v2 v2.5.33
github.com/vikstrous/dataloadgen v0.0.6
github.com/yuin/gopher-lua v1.1.2
github.com/zitadel/oidc/v3 v3.33.1
github.com/zitadel/zitadel-go/v3 v3.4.3
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0
go.opentelemetry.io/otel v1.44.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0
Expand All @@ -74,7 +74,7 @@ require (
go.opentelemetry.io/otel/sdk v1.44.0
go.opentelemetry.io/otel/sdk/metric v1.44.0
go.opentelemetry.io/otel/trace v1.44.0
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f
golang.org/x/oauth2 v0.36.0
golang.org/x/sync v0.22.0
golang.org/x/text v0.41.0
Expand All @@ -83,9 +83,9 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7
google.golang.org/grpc v1.83.1
google.golang.org/protobuf v1.36.12
k8s.io/api v0.36.0
k8s.io/apimachinery v0.36.4
k8s.io/client-go v0.36.0
k8s.io/api v0.37.0
k8s.io/apimachinery v0.37.0
k8s.io/client-go v0.37.0
k8s.io/klog/v2 v2.140.0
k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3
sigs.k8s.io/yaml v1.6.0
Expand Down Expand Up @@ -189,37 +189,38 @@ require (
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-openapi/analysis v0.25.0 // indirect
github.com/go-openapi/errors v0.22.7 // indirect
github.com/go-openapi/jsonpointer v0.23.1 // indirect
github.com/go-openapi/jsonreference v0.21.5 // indirect
github.com/go-openapi/jsonpointer v1.0.0 // indirect
github.com/go-openapi/jsonreference v1.0.0 // indirect
github.com/go-openapi/loads v0.23.3 // indirect
github.com/go-openapi/spec v0.22.4 // indirect
github.com/go-openapi/strfmt v0.26.2 // indirect
github.com/go-openapi/swag v0.25.5 // indirect
github.com/go-openapi/swag/cmdutils v0.25.5 // indirect
github.com/go-openapi/swag/conv v0.25.5 // indirect
github.com/go-openapi/swag/fileutils v0.25.5 // indirect
github.com/go-openapi/swag v0.27.1 // indirect
github.com/go-openapi/swag/cmdutils v0.27.1 // indirect
github.com/go-openapi/swag/conv v0.27.1 // indirect
github.com/go-openapi/swag/fileutils v0.27.1 // indirect
github.com/go-openapi/swag/jsonname v0.26.0 // indirect
github.com/go-openapi/swag/jsonutils v0.25.5 // indirect
github.com/go-openapi/swag/loading v0.25.5 // indirect
github.com/go-openapi/swag/mangling v0.25.5 // indirect
github.com/go-openapi/swag/netutils v0.25.5 // indirect
github.com/go-openapi/swag/stringutils v0.25.5 // indirect
github.com/go-openapi/swag/typeutils v0.25.5 // indirect
github.com/go-openapi/swag/yamlutils v0.25.5 // indirect
github.com/go-openapi/swag/jsonutils v0.27.1 // indirect
github.com/go-openapi/swag/loading v0.27.1 // indirect
github.com/go-openapi/swag/mangling v0.27.1 // indirect
github.com/go-openapi/swag/netutils v0.27.1 // indirect
github.com/go-openapi/swag/pools v0.27.1 // indirect
github.com/go-openapi/swag/stringutils v0.27.1 // indirect
github.com/go-openapi/swag/typeutils v0.27.1 // indirect
github.com/go-openapi/swag/yamlutils v0.27.1 // indirect
github.com/go-openapi/validate v0.25.2 // indirect
github.com/go-sql-driver/mysql v1.9.3 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
Expand All @@ -235,7 +236,7 @@ require (
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.28.0 // indirect
github.com/google/cel-go v0.29.2 // indirect
github.com/google/flatbuffers v25.12.19+incompatible // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/s2a-go v0.1.9 // indirect
Expand Down Expand Up @@ -270,7 +271,6 @@ require (
github.com/hashicorp/memberlist v0.5.4 // indirect
github.com/hashicorp/serf v0.10.2 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/tdigest v0.0.2-0.20210216194612-fc98d27c9e8b // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
Expand All @@ -285,7 +285,7 @@ require (
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/kamstrup/intmap v0.5.2 // indirect
github.com/kelseyhightower/envconfig v1.4.0 // indirect
github.com/klauspost/compress v1.18.6 // indirect
github.com/klauspost/compress v1.19.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/knadh/koanf/maps v0.1.2 // indirect
github.com/knadh/koanf/parsers/yaml v1.1.0 // indirect
Expand Down Expand Up @@ -359,7 +359,7 @@ require (
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/exporter-toolkit v0.16.0 // indirect
github.com/prometheus/otlptranslator v1.0.0 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/prometheus/sigv4 v0.4.1 // indirect
github.com/puzpuzpuz/xsync/v4 v4.5.0 // indirect
github.com/redis/go-redis/v9 v9.18.0 // indirect
Expand Down Expand Up @@ -407,9 +407,9 @@ require (
github.com/zitadel/logging v0.6.1 // indirect
github.com/zitadel/schema v1.3.0 // indirect
go.etcd.io/bbolt v1.5.0 // indirect
go.etcd.io/etcd/api/v3 v3.6.8 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.6.8 // indirect
go.etcd.io/etcd/client/v3 v3.6.8 // indirect
go.etcd.io/etcd/api/v3 v3.7.0 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.7.0 // indirect
go.etcd.io/etcd/client/v3 v3.7.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/collector/component v1.59.0 // indirect
Expand Down Expand Up @@ -444,7 +444,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.28.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect
go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect
golang.org/x/crypto v0.54.0 // indirect
Expand All @@ -467,13 +467,13 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.7.0 // indirect
k8s.io/apiextensions-apiserver v0.36.0 // indirect
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect
k8s.io/apiextensions-apiserver v0.37.0 // indirect
k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect
mvdan.cc/gofumpt v0.9.2 // indirect
sigs.k8s.io/controller-runtime v0.24.1 // indirect
sigs.k8s.io/controller-runtime v0.25.1 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.3 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.4.2 // indirect
)

replace github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp => ./mockgcp
Expand All @@ -483,3 +483,10 @@ replace github.com/hashicorp/terraform-provider-google-beta => ./third_party/git
replace github.com/nais/api/pkg/apiclient => ./pkg/apiclient

replace github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20251126142931-6f9f62ab6f86

// Loki's dskit dependency is not compatible with the etcd 3.7 API pulled in by pgrator's Kubernetes dependencies.
replace go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.6.14

replace go.etcd.io/etcd/client/pkg/v3 => go.etcd.io/etcd/client/pkg/v3 v3.6.14

replace go.etcd.io/etcd/client/v3 => go.etcd.io/etcd/client/v3 v3.6.14
Loading
Loading