Skip to content

Commit 4b2fcc4

Browse files
Merge pull request #39 from echen-98/user-support
Enable Passwords field (upon creation)
2 parents 88987fd + a839b74 commit 4b2fcc4

File tree

12 files changed

+171
-49
lines changed

12 files changed

+171
-49
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
ack_generate_info:
2-
build_date: "2021-07-01T00:05:05Z"
2+
build_date: "2021-07-01T01:00:26Z"
33
build_hash: 9fec5f08628d5dcc3af38d517ea014930b1ae39d
44
go_version: go1.15.2 darwin/amd64
55
version: v0.3.1
6-
api_directory_checksum: 9b3b2aba266495c0066bcda32c685f5392eaa4c3
6+
api_directory_checksum: a0e397840365dfef9f86900d211b96e5040cf6a9
77
api_version: v1alpha1
88
aws_sdk_go_version: ""
99
generator_config_info:
10-
file_checksum: 4c9de6e616b479328ab112b111a77382551cee21
10+
file_checksum: fa5597fbe4affa148d62ff2079b8d12ac1e07098
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation
14-
timestamp: 2021-07-01 00:06:30.140979 +0000 UTC
14+
timestamp: 2021-07-01 01:00:35.012299 +0000 UTC

apis/v1alpha1/generator.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ resources:
129129
from:
130130
operation: CreateUser
131131
path: AccessString
132+
Passwords:
133+
is_secret: true
134+
compare:
135+
is_ignored: true
132136
hooks:
133137
sdk_read_many_post_set_output:
134138
code: "rm.setSyncedCondition(resp.Users[0].Status, &resource{ko})"
@@ -193,7 +197,6 @@ ignore:
193197
- DescribeSnapshotsInput.ReplicationGroupId
194198
- DescribeSnapshotsInput.SnapshotSource
195199
- DescribeUsersInput.Engine
196-
- CreateUserInput.Passwords #TODO: remove this once we have support for k8s secrets within slices
197200
- ModifyUserInput.AccessString
198201
- ModifyUserInput.NoPasswordRequired
199202
- ModifyUserInput.Passwords

apis/v1alpha1/user.go

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

apis/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/elasticache.services.k8s.aws_users.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,28 @@ spec:
4444
noPasswordRequired:
4545
description: Indicates a password is not required for this user.
4646
type: boolean
47+
passwords:
48+
description: Passwords used for this user. You can create up to two
49+
passwords for each user.
50+
items:
51+
description: SecretKeyReference combines a k8s corev1.SecretReference
52+
with a specific key within the referred-to Secret
53+
properties:
54+
key:
55+
description: Key is the key within the secret
56+
type: string
57+
name:
58+
description: Name is unique within a namespace to reference
59+
a secret resource.
60+
type: string
61+
namespace:
62+
description: Namespace defines the space within which the secret
63+
name must be unique.
64+
type: string
65+
required:
66+
- key
67+
type: object
68+
type: array
4769
userID:
4870
description: The ID of the user.
4971
type: string

generator.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ resources:
136136
from:
137137
operation: CreateUser
138138
path: AccessString
139+
Passwords:
140+
is_secret: true
141+
compare:
142+
is_ignored: true
139143
hooks:
140144
sdk_read_many_post_set_output:
141145
code: "rm.setSyncedCondition(resp.Users[0].Status, &resource{ko})"
@@ -200,7 +204,6 @@ ignore:
200204
- DescribeSnapshotsInput.ReplicationGroupId
201205
- DescribeSnapshotsInput.SnapshotSource
202206
- DescribeUsersInput.Engine
203-
- CreateUserInput.Passwords #TODO: remove this once we have support for k8s secrets within slices
204207
- ModifyUserInput.AccessString
205208
- ModifyUserInput.NoPasswordRequired
206209
- ModifyUserInput.Passwords

pkg/resource/user/post_build_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ func (rm *resourceManager) populateUpdatePayload(
3434
input.NoPasswordRequired = r.ko.Spec.NoPasswordRequired
3535
}
3636

37-
//TODO: add the passwords field here once we have secrets support for it
37+
//TODO: add update for passwords field once we have framework-level support
3838

3939
}

pkg/resource/user/sdk.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: elasticache.services.k8s.aws/v1alpha1
2+
kind: User
3+
metadata:
4+
name: $USER_ID
5+
spec:
6+
accessString: $ACCESS_STRING
7+
engine: redis
8+
passwords:
9+
- namespace: default
10+
name: $NAME1
11+
key: $KEY1
12+
- namespace: default
13+
name: $NAME2
14+
key: $KEY2
15+
userID: $USER_ID
16+
userName: $USER_ID

0 commit comments

Comments
 (0)