Skip to content

Commit a2f2035

Browse files
authored
Merge branch 'movetokube:master' into master
2 parents 95915f2 + c9b2ac5 commit a2f2035

File tree

13 files changed

+234
-37
lines changed

13 files changed

+234
-37
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ jobs:
1616
- uses: actions/checkout@v5
1717
- uses: actions/setup-go@v6
1818
with:
19-
go-version: "1.24.2"
19+
go-version: "stable"
2020
- run: |
21+
go clean -modcache
2122
make test
2223
build:
2324
runs-on: ubuntu-latest
@@ -26,7 +27,8 @@ jobs:
2627
- uses: actions/checkout@v5
2728
- uses: actions/setup-go@v6
2829
with:
29-
go-version: "1.24.2"
30+
go-version: "stable"
3031
- run: |
32+
go clean -modcache
3133
make build
3234
file bin/manager

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ deploy/secret.yaml
3333
# kuttl/kind
3434
tests/kind-logs-*/
3535
kubeconfig
36+
37+
.gomodcache
38+
.gocache

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
196196

197197
## Tool Versions
198198
KUSTOMIZE_VERSION ?= v5.4.3
199-
CONTROLLER_TOOLS_VERSION ?= v0.16.1
199+
CONTROLLER_TOOLS_VERSION ?= v0.19.0
200200
ENVTEST_VERSION ?= release-0.19
201201

202202
.PHONY: kustomize

api/v1alpha1/postgresuser_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,27 @@ type PostgresUserSpec struct {
1717
// +optional
1818
Privileges string `json:"privileges"`
1919
// +optional
20+
AWS *PostgresUserAWSSpec `json:"aws,omitempty"`
21+
// +optional
2022
Annotations map[string]string `json:"annotations,omitempty"`
2123
// +optional
2224
Labels map[string]string `json:"labels,omitempty"`
2325
}
2426

27+
// PostgresUserAWSSpec encapsulates AWS specific configuration toggles.
28+
type PostgresUserAWSSpec struct {
29+
// +optional
30+
EnableIamAuth bool `json:"enableIamAuth,omitempty"`
31+
}
32+
2533
// PostgresUserStatus defines the observed state of PostgresUser
2634
type PostgresUserStatus struct {
2735
Succeeded bool `json:"succeeded"`
2836
PostgresRole string `json:"postgresRole"`
2937
PostgresLogin string `json:"postgresLogin"`
3038
PostgresGroup string `json:"postgresGroup"`
3139
DatabaseName string `json:"databaseName"`
40+
EnableIamAuth bool `json:"enableIamAuth"`
3241
}
3342

3443
// +kubebuilder:object:root=true

charts/ext-postgres-operator/crds/db.movetokube.com_postgresusers_crd.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,29 @@ spec:
3535
additionalProperties:
3636
type: string
3737
type: object
38+
aws:
39+
description: AWS specific settings for the user
40+
properties:
41+
enableIamAuth:
42+
description: Enable IAM authentication for this user (PostgreSQL on AWS RDS only)
43+
default: false
44+
type: boolean
45+
type: object
3846
database:
47+
description: Name of the PostgresDatabase this user will be related to
3948
type: string
4049
labels:
4150
additionalProperties:
4251
type: string
4352
type: object
4453
privileges:
54+
description: List of privileges to grant to this user
4555
type: string
4656
role:
57+
description: Name of the PostgresRole this user will be associated with
4758
type: string
4859
secretName:
60+
description: Name of the secret to create with user credentials
4961
type: string
5062
secretTemplate:
5163
additionalProperties:
@@ -59,6 +71,9 @@ spec:
5971
status:
6072
description: PostgresUserStatus defines the observed state of PostgresUser
6173
properties:
74+
enableIamAuth:
75+
description: Reflects whether IAM authentication is enabled for this user.
76+
type: boolean
6277
databaseName:
6378
type: string
6479
postgresGroup:

config/crd/bases/db.movetokube.com_postgres.yaml

Lines changed: 7 additions & 12 deletions
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.19.0
77
name: postgres.db.movetokube.com
88
spec:
99
group: db.movetokube.com
@@ -20,19 +20,14 @@ spec:
2020
description: Postgres is the Schema for the postgres API
2121
properties:
2222
apiVersion:
23-
description: |-
24-
APIVersion defines the versioned schema of this representation of an object.
25-
Servers should convert recognized schemas to the latest internal value, and
26-
may reject unrecognized values.
27-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
23+
description: 'APIVersion defines the versioned schema of this representation
24+
of an object. Servers should convert recognized schemas to the latest
25+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
2826
type: string
2927
kind:
30-
description: |-
31-
Kind is a string value representing the REST resource this object represents.
32-
Servers may infer this from the endpoint the client submits requests to.
33-
Cannot be updated.
34-
In CamelCase.
35-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
28+
description: 'Kind is a string value representing the REST resource this
29+
object represents. Servers may infer this from the endpoint the client
30+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
3631
type: string
3732
metadata:
3833
type: object

config/crd/bases/db.movetokube.com_postgresusers.yaml

Lines changed: 22 additions & 12 deletions
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.19.0
77
name: postgresusers.db.movetokube.com
88
spec:
99
group: db.movetokube.com
@@ -20,19 +20,14 @@ spec:
2020
description: PostgresUser is the Schema for the postgresusers API
2121
properties:
2222
apiVersion:
23-
description: |-
24-
APIVersion defines the versioned schema of this representation of an object.
25-
Servers should convert recognized schemas to the latest internal value, and
26-
may reject unrecognized values.
27-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
23+
description: 'APIVersion defines the versioned schema of this representation
24+
of an object. Servers should convert recognized schemas to the latest
25+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
2826
type: string
2927
kind:
30-
description: |-
31-
Kind is a string value representing the REST resource this object represents.
32-
Servers may infer this from the endpoint the client submits requests to.
33-
Cannot be updated.
34-
In CamelCase.
35-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
28+
description: 'Kind is a string value representing the REST resource this
29+
object represents. Servers may infer this from the endpoint the client
30+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
3631
type: string
3732
metadata:
3833
type: object
@@ -43,17 +38,29 @@ spec:
4338
additionalProperties:
4439
type: string
4540
type: object
41+
aws:
42+
description: AWS specific settings for this user.
43+
properties:
44+
enableIamAuth:
45+
description: Enable IAM authentication for this user (PostgreSQL on AWS RDS only)
46+
default: false
47+
type: boolean
48+
type: object
4649
database:
50+
description: Name of the PostgresDatabase this user will be related to
4751
type: string
4852
labels:
4953
additionalProperties:
5054
type: string
5155
type: object
5256
privileges:
57+
description: List of privileges to grant to this user
5358
type: string
5459
role:
60+
description: Name of the PostgresRole this user will be associated with
5561
type: string
5662
secretName:
63+
description: Name of the secret to create with user credentials
5764
type: string
5865
secretTemplate:
5966
additionalProperties:
@@ -67,6 +74,9 @@ spec:
6774
status:
6875
description: PostgresUserStatus defines the observed state of PostgresUser
6976
properties:
77+
enableIamAuth:
78+
description: Reflects whether IAM authentication is enabled for this user.
79+
type: boolean
7080
databaseName:
7181
type: string
7282
postgresGroup:

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/movetokube/postgres-operator
22

3-
go 1.24.0
3+
go 1.25.1
44

55
require (
66
github.com/go-logr/logr v1.4.3
@@ -56,7 +56,7 @@ require (
5656
github.com/prometheus/common v0.62.0 // indirect
5757
github.com/prometheus/procfs v0.15.1 // indirect
5858
github.com/spf13/cobra v1.9.1 // indirect
59-
github.com/spf13/pflag v1.0.6 // indirect
59+
github.com/spf13/pflag v1.0.7 // indirect
6060
github.com/stoewer/go-strcase v1.3.0 // indirect
6161
github.com/x448/float16 v0.8.4 // indirect
6262
go.opentelemetry.io/auto/sdk v1.1.0 // indirect

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWN
122122
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
123123
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
124124
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
125-
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
126125
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
126+
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
127+
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
127128
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
128129
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
129130
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

internal/controller/postgres_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func (r *PostgresReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
256256
}
257257
}
258258

259-
reqLogger.Info("reconciler done", "CR.Namespace", instance.Namespace, "CR.Name", instance.Name)
259+
reqLogger.Info("Reconciling done")
260260
return ctrl.Result{}, nil
261261
}
262262
func (r *PostgresReconciler) addFinalizer(reqLogger logr.Logger, m *dbv1alpha1.Postgres) error {

0 commit comments

Comments
 (0)