Skip to content

Commit d85ccf4

Browse files
committed
Update API definition
1 parent a58ac2f commit d85ccf4

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

api/v1alpha1/postgresuser_types.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import (
99

1010
// PostgresUserSpec defines the desired state of PostgresUser
1111
type PostgresUserSpec struct {
12-
Role string `json:"role"`
13-
Database string `json:"database"`
12+
// Name of the PostgresRole this user will be associated with
13+
Role string `json:"role"`
14+
// Name of the PostgresDatabase this user will be related to
15+
Database string `json:"database"`
16+
// Name of the secret to create with user credentials
1417
SecretName string `json:"secretName"`
1518
// +optional
1619
SecretTemplate map[string]string `json:"secretTemplate,omitempty"` // key-value, where key is secret field, value is go template
1720
// +optional
21+
// List of privileges to grant to this user
1822
Privileges string `json:"privileges"`
1923
// +optional
2024
AWS *PostgresUserAWSSpec `json:"aws,omitempty"`
@@ -27,6 +31,8 @@ type PostgresUserSpec struct {
2731
// PostgresUserAWSSpec encapsulates AWS specific configuration toggles.
2832
type PostgresUserAWSSpec struct {
2933
// +optional
34+
// +kubebuilder:default=false
35+
// Enable IAM authentication for this user (PostgreSQL on AWS RDS only)
3036
EnableIamAuth bool `json:"enableIamAuth,omitempty"`
3137
}
3238

@@ -37,7 +43,9 @@ type PostgresUserStatus struct {
3743
PostgresLogin string `json:"postgresLogin"`
3844
PostgresGroup string `json:"postgresGroup"`
3945
DatabaseName string `json:"databaseName"`
40-
EnableIamAuth bool `json:"enableIamAuth"`
46+
// Reflects whether IAM authentication is enabled for this user.
47+
// +optional
48+
EnableIamAuth bool `json:"enableIamAuth"`
4149
}
4250

4351
// +kubebuilder:object:root=true

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,28 @@ spec:
4848
toggles.
4949
properties:
5050
enableIamAuth:
51+
default: false
52+
description: Enable IAM authentication for this user (PostgreSQL
53+
on AWS RDS only)
5154
type: boolean
5255
type: object
5356
database:
57+
description: Name of the PostgresDatabase this user will be related
58+
to
5459
type: string
5560
labels:
5661
additionalProperties:
5762
type: string
5863
type: object
5964
privileges:
65+
description: List of privileges to grant to this user
6066
type: string
6167
role:
68+
description: Name of the PostgresRole this user will be associated
69+
with
6270
type: string
6371
secretName:
72+
description: Name of the secret to create with user credentials
6473
type: string
6574
secretTemplate:
6675
additionalProperties:
@@ -77,6 +86,8 @@ spec:
7786
databaseName:
7887
type: string
7988
enableIamAuth:
89+
description: Reflects whether IAM authentication is enabled for this
90+
user.
8091
type: boolean
8192
postgresGroup:
8293
type: string
@@ -88,7 +99,6 @@ spec:
8899
type: boolean
89100
required:
90101
- databaseName
91-
- enableIamAuth
92102
- postgresGroup
93103
- postgresLogin
94104
- postgresRole

0 commit comments

Comments
 (0)