Skip to content

Add serverlesscache to elasticache #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rushmash91
Copy link
Member

@rushmash91 rushmash91 commented Jul 17, 2025

fixes aws-controllers-k8s/community#2522

Description of changes:

  • Add support serverlesscache resource

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from a-hilaly and jlbutler July 17, 2025 22:03
Copy link

ack-prow bot commented Jul 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rushmash91

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the approved label Jul 17, 2025
@rushmash91 rushmash91 force-pushed the elasticache-add-serverlesscache branch from 4e8c424 to 23bb928 Compare July 17, 2025 22:57
@rushmash91 rushmash91 force-pushed the elasticache-add-serverlesscache branch from fc9cbc6 to 667b5c5 Compare July 17, 2025 23:51
@rushmash91
Copy link
Member Author

/test elasticache-kind-e2e

@rushmash91 rushmash91 force-pushed the elasticache-add-serverlesscache branch 4 times, most recently from 1f5cf20 to 61ea0e8 Compare July 18, 2025 07:48
@rushmash91
Copy link
Member Author

unrelated test..
/test elasticache-kind-e2e

@rushmash91 rushmash91 force-pushed the elasticache-add-serverlesscache branch from 61ea0e8 to 767653a Compare July 21, 2025 17:27
Comment on lines +319 to +321
synced:
when:
- path: Status.Status
in:
- available
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status here should be capitalized: https://github.com/aws/aws-sdk-go-v2/blob/0475b822f1f48ca746369818d51272f989c06b91/service/elasticache/types/types.go#L2019

Also, should CREATE_FAILED be a synced/terminal condition?

Comment on lines +326 to +330
- ServerlessCacheAlreadyExistsFault
- ServerlessCacheQuotaForCustomerExceededFault
- InvalidParameterValue
- InvalidParameterCombination
- InvalidVPCNetworkStateFault
- TagQuotaPerResourceExceeded
- InvalidKMSKeyFault
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should ensure these are truly terminal

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change for all resources? havent had any customer issues reported yet.

print:
add_age_column: true
add_synced_column: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are true by default i believe

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No they are not, trying to have serverless cache as consistent with cache cluster as possible..

if r.ko.Status.Status == nil {
return false
}
return *r.ko.Status.Status == "creating"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the states Constants?
Also this one should also be capitalized

if r.ko.Status.Status == nil {
return false
}
return *r.ko.Status.Status == "deleting"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

if r.ko.Status.Status == nil {
return false
}
return *r.ko.Status.Status == "modifying"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines +137 to +173
case delta.DifferentAt("Spec.Description"):
if err := rm.syncDescription(ctx, desired); err != nil {
return nil, fmt.Errorf("cannot update serverless cache: %v", err)
}

case delta.DifferentAt("Spec.Tags"):
if err := rm.syncTags(ctx, desired, latest); err != nil {
return &resource{ko}, err
}

case delta.DifferentAt("Spec.DailySnapshotTime"):
if err := rm.syncDailySnapshotTime(ctx, desired); err != nil {
return nil, fmt.Errorf("cannot update serverless cache: %v", err)
}

case delta.DifferentAt("Spec.SnapshotRetentionLimit"):
if err := rm.syncSnapshotRetentionLimit(ctx, desired); err != nil {
return nil, fmt.Errorf("cannot update serverless cache: %v", err)
}

case delta.DifferentAt("Spec.SecurityGroupIDs"):
if err := rm.syncSecurityGroupIDs(ctx, desired); err != nil {
return nil, fmt.Errorf("cannot update serverless cache: %v", err)
}

case delta.DifferentAt("Spec.UserGroupID"):
if err := rm.syncUserGroupID(ctx, desired); err != nil {
return nil, fmt.Errorf("cannot update serverless cache: %v", err)
}

case delta.DifferentAt("Spec.CacheUsageLimits"):
if err := rm.syncCacheUsageLimits(ctx, desired); err != nil {
return nil, fmt.Errorf("cannot update serverless cache: %v", err)
}

case delta.DifferentAt("Spec.Engine") || delta.DifferentAt("Spec.MajorEngineVersion"):
if err := rm.syncEngineAndVersion(ctx, desired); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not set all values in the same call (except Tags)? with this code we will be updating a single field at a time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the point 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rushmash91 rushmash91 force-pushed the elasticache-add-serverlesscache branch from 767653a to c18af55 Compare July 22, 2025 20:17
Copy link

ack-prow bot commented Jul 22, 2025

@rushmash91: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
elasticache-verify-attribution c18af55 link false /test elasticache-verify-attribution

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Resource] Elasticache Controller
3 participants