Skip to content

Commit c3edf52

Browse files
authored
Fix incorrect status of cluster and snapshot (#56)
Issue #, if available: 1. `status` of cluster and snapshot should be `available` instead of `active`. 2. names of function for checking `status` of resources are not proper. Description of changes: 1. Add `synced` of snapshot into generator. Correct `status` of cluster and snapshot from `active` to `available`. 2. Uncomment some parts in two yaml test files related to tags update of cluster and snapshot. 3. Modify functions for checking `status` of cluster, snapshot, acl, user to proper names. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f14c766 commit c3edf52

File tree

18 files changed

+68
-50
lines changed

18 files changed

+68
-50
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2023-02-23T20:04:23Z"
2+
build_date: "2023-03-02T08:20:25Z"
33
build_hash: d0f3d78cbea8061f822cbceac3786128f091efe6
44
go_version: go1.19
55
version: v0.24.2
66
api_directory_checksum: ee32acc4d4a0ba7e2823dd20fdbe2c4ef1d9e0f4
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 19e41b58c6c4d1971db53e6c1694da632d71d053
10+
file_checksum: 24db040eb331d4873d608c73f3318ae9cd11eb02
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ resources:
237237
DescribeSnapshots:
238238
input_fields:
239239
SnapshotName: Name
240+
synced:
241+
when:
242+
- path: Status.Status
243+
in:
244+
- available
240245
ParameterGroup:
241246
exceptions:
242247
errors:

generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ resources:
237237
DescribeSnapshots:
238238
input_fields:
239239
SnapshotName: Name
240+
synced:
241+
when:
242+
- path: Status.Status
243+
in:
244+
- available
240245
ParameterGroup:
241246
exceptions:
242247
errors:

pkg/resource/acl/hooks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func (rm *resourceManager) validateACLNeedsUpdate(
4545
return nil
4646
}
4747

48-
// aclActive returns true when the status of the given ACL is set to `active`
49-
func (rm *resourceManager) aclActive(
48+
// isACLActive returns true when the status of the given ACL is set to `active`
49+
func (rm *resourceManager) isACLActive(
5050
latest *resource,
5151
) bool {
5252
latestStatus := latest.ko.Status.Status

pkg/resource/acl/sdk.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/cluster/hooks.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
var (
3232
condMsgCurrentlyDeleting = "cluster currently being deleted"
3333
condMsgNoDeleteWhileUpdating = "cluster is being updated. cannot delete"
34-
resourceStatusActive string = "active"
34+
resourceStatusAvailable string = "available"
3535
)
3636

3737
var (
@@ -264,12 +264,12 @@ func (rm *resourceManager) newMemoryDBClusterUploadPayload(
264264
return res
265265
}
266266

267-
// clusterActive returns true when the status of the given Cluster is set to `active`
268-
func (rm *resourceManager) clusterActive(
267+
// isClusterAvailable returns true when the status of the given Cluster is set to `available`
268+
func (rm *resourceManager) isClusterAvailable(
269269
latest *resource,
270270
) bool {
271271
latestStatus := latest.ko.Status.Status
272-
return latestStatus != nil && *latestStatus == resourceStatusActive
272+
return latestStatus != nil && *latestStatus == resourceStatusAvailable
273273
}
274274

275275
// getTags gets tags from given ParameterGroup.

pkg/resource/cluster/sdk.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/snapshot/hooks.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
var (
32-
resourceStatusActive string = "active"
32+
resourceStatusAvailable string = "available"
3333
)
3434

3535
func (rm *resourceManager) customDescribeSnapshotSetOutput(
@@ -251,12 +251,12 @@ func (rm *resourceManager) newCopySnapshotPayload(
251251
return res, nil
252252
}
253253

254-
// snapshotActive returns true when the status of the given Snapshot is set to `active`
255-
func (rm *resourceManager) snapshotActive(
254+
// isSnapshotAvailable returns true when the status of the given Snapshot is set to `available`
255+
func (rm *resourceManager) isSnapshotAvailable(
256256
latest *resource,
257257
) bool {
258258
latestStatus := latest.ko.Status.Status
259-
return latestStatus != nil && *latestStatus == resourceStatusActive
259+
return latestStatus != nil && *latestStatus == resourceStatusAvailable
260260
}
261261

262262
// getTags gets tags from given ParameterGroup.

pkg/resource/snapshot/manager.go

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

pkg/resource/snapshot/sdk.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)