Skip to content

Commit f52e5e6

Browse files
authored
feat: postgresuser role attributes (#194)
1 parent ff7403c commit f52e5e6

30 files changed

Lines changed: 485 additions & 378 deletions

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Go
2121
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2222
with:
23-
go-version: 1.22.x
23+
go-version: 1.25.x
2424
- name: Tests
2525
run: make test
2626
- name: Send go coverage report

.github/workflows/pr-build.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ jobs:
7676
strategy:
7777
matrix:
7878
kubernetes-version:
79-
- "1.27"
80-
- "1.28"
81-
- "1.29"
82-
- "1.30"
79+
- "1.31"
80+
- "1.32"
81+
- "1.33"
82+
- "1.34"
8383
steps:
8484
- name: Harden Runner
8585
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
@@ -90,7 +90,7 @@ jobs:
9090
- name: Setup Go
9191
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
9292
with:
93-
go-version: 1.22.x
93+
go-version: 1.25.x
9494
- name: run test
9595
run: make test ENVTEST_K8S_VERSION=${{ matrix.kubernetes-version }}
9696

@@ -108,7 +108,7 @@ jobs:
108108
- name: Setup Go
109109
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
110110
with:
111-
go-version: 1.22.x
111+
go-version: 1.25.x
112112
- name: build
113113
run: make build
114114
- name: Check if working tree is dirty
@@ -153,7 +153,7 @@ jobs:
153153
- name: Setup Go
154154
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
155155
with:
156-
go-version: 1.22.x
156+
go-version: 1.25.x
157157
- name: Setup Kubernetes
158158
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0
159159
with:

.github/workflows/pr-trivy.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Harden Runner
11-
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
11+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
1212
with:
1313
egress-policy: audit
1414

1515
- name: Trivy fs scan
16-
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # 0.30.0
16+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
1717
with:
1818
scan-type: 'fs'
1919
ignore-unfixed: true
@@ -23,6 +23,6 @@ jobs:
2323
severity: 'CRITICAL,HIGH'
2424

2525
- name: Upload Trivy scan results to GitHub Security tab
26-
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
26+
uses: github/codeql-action/upload-sarif@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
2727
with:
2828
sarif_file: 'trivy-results.sarif'

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fetch-depth: 0
2525
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2626
with:
27-
go-version: '1.22'
27+
go-version: 1.25.x
2828
- name: Docker Login
2929
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
3030
with:

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ kind-test: docker-build ## Deploy including test
133133
CONTROLLER_GEN = $(GOBIN)/controller-gen
134134
.PHONY: controller-gen
135135
controller-gen: ## Download controller-gen locally if necessary.
136-
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.1)
136+
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.20.0)
137137

138138
GOLANGCI_LINT = $(GOBIN)/golangci-lint
139139
.PHONY: golangci-lint
140140
golangci-lint: ## Download golint locally if necessary
141-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.0)
141+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.2)
142142

143143
KUSTOMIZE = $(GOBIN)/kustomize
144144
.PHONY: kustomize
@@ -148,7 +148,7 @@ kustomize: ## Download kustomize locally if necessary.
148148
ENVTEST = $(GOBIN)/setup-envtest
149149
.PHONY: envtest
150150
envtest: ## Download envtest-setup locally if necessary.
151-
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.17)
151+
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.22)
152152

153153
# go-install-tool will 'go install' any package $2 and install it to $1
154154
define go-install-tool

api/v1beta1/postgresqluser_type.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ type PostgreSQLUserSpec struct {
3737

3838
// Roles are postgres roles granted to this user
3939
Roles []string `json:"roles,omitempty"`
40+
41+
// Attributes are postgres attributes associated with this user
42+
Attributes []string `json:"attributes,omitempty"`
4043
}
4144

4245
type Grant struct {

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chart/db-controller/crds/dbprovisioning.infra.doodle.com_mongodbdatabases.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.20.0
77
name: mongodbdatabases.dbprovisioning.infra.doodle.com
88
spec:
99
group: dbprovisioning.infra.doodle.com

chart/db-controller/crds/dbprovisioning.infra.doodle.com_mongodbusers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.20.0
77
name: mongodbusers.dbprovisioning.infra.doodle.com
88
spec:
99
group: dbprovisioning.infra.doodle.com

chart/db-controller/crds/dbprovisioning.infra.doodle.com_postgresqldatabases.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.20.0
77
name: postgresqldatabases.dbprovisioning.infra.doodle.com
88
spec:
99
group: dbprovisioning.infra.doodle.com

0 commit comments

Comments
 (0)