-
Notifications
You must be signed in to change notification settings - Fork 204
feat(ECS): enable selection of listener rules #4668
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
feat(ECS): enable selection of listener rules #4668
Conversation
|
@khanhtc1202 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4668 +/- ##
==========================================
- Coverage 30.82% 30.75% -0.08%
==========================================
Files 221 221
Lines 25935 26009 +74
==========================================
+ Hits 7995 7999 +4
- Misses 17289 17360 +71
+ Partials 651 650 -1 ☔ View full report in Codecov by Sentry. |
|
@moko-poi Please sign the commit with |
Signed-off-by: moko-poi <[email protected]>
Signed-off-by: moko-poi <[email protected]>
* Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (pipe-cd#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]>
Signed-off-by: moko-poi <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]>
1c26321 to
5b3ac3f
Compare
|
@khanhtc1202 Thank you for pointing this out |
| return false | ||
| } | ||
|
|
||
| if err := client.ModifyListenerOrRule(ctx, currListenerArns, currListenerRuleArns, routingTrafficCfg); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing currListenerRuleArns to the function ModifyListenerOrRule (yes, the name is confusing), we should check currListenerRuleArns > 0 in this place, and call to ModifyRules if the condition check passed or call to ModifyListeners (the previous one) if the condition return false. wdyt? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khanhtc1202
Thanks for the review. I've implemented the check for currListenerRuleArns and used ModifyRules or ModifyListeners accordingly to enhance rollback precision.
965ba41
| return nil | ||
| } | ||
|
|
||
| func (c *client) ModifyListenerOrRule(ctx context.Context, listenerRuleArns []string, routingTrafficCfg RoutingTrafficConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rename this to ModifyRules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you,Correspondence
3a4bea5
Signed-off-by: moko-poi <[email protected]>
Signed-off-by: moko-poi <[email protected]>
Signed-off-by: moko-poi <[email protected]>
Signed-off-by: moko-poi <[email protected]>
|
@khanhtc1202 |
| // Check if the current action type is forward | ||
| for _, rule := range describelistenerOutput.Rules { | ||
| for _, action := range rule.Actions { | ||
| if action.Type == elbtypes.ActionTypeEnumForward { | ||
| // Call modifyListenerRule only if action type is forward | ||
| if err := modifyListener(ctx, listener); err != nil { | ||
| return err | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will delete all other rules of a given listener in case that listener contains rules of type ActionTypeEnumForward ? 🤔 So this code change means nothing, I guess. wdyt? @moko-poi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khanhtc1202
2650922
Thank you for your review.
I have made the necessary adjustments to the ModifyListeners and ModifyRules functions to address the concerns. Now, these functions only modify actions of type ActionTypeEnumForward and preserve all other action types, ensuring that existing listener and rule configurations are not inadvertently altered.
…fication Signed-off-by: moko-poi <[email protected]>
khanhtc1202
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @moko-poi 🙌
I will merge this and keep working based on this PR 👍
* feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]>
* feat(ECS): enable selection of listener rules (#4668) * feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> * Remove ModifyRules interface (#4688) --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Shun Takahashi <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]>
* feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (pipe-cd#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (pipe-cd#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (pipe-cd#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (pipe-cd#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]>
* feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (pipe-cd#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (pipe-cd#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (pipe-cd#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (pipe-cd#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]>
* feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (pipe-cd#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (pipe-cd#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (pipe-cd#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (pipe-cd#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> Signed-off-by: sZma5a <[email protected]>
* feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (pipe-cd#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (pipe-cd#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (pipe-cd#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (pipe-cd#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> Signed-off-by: sZma5a <[email protected]>
* feat(ECS): enable selection of listener rules Signed-off-by: moko-poi <[email protected]> * Update pkg/app/piped/platformprovider/ecs/client.go Signed-off-by: moko-poi <[email protected]> * Make actions plan preview handle timeout option (pipe-cd#4648) * Format and make tests pass in tool/actions-plan-preview Signed-off-by: mi11km <[email protected]> * Use --piped-handle-timeout to make the timeout arg activate Signed-off-by: mi11km <[email protected]> * Add tests to model/notificationevent (pipe-cd#4631) * Add tests to model/notificationevent Signed-off-by: Kenta Kozuka <[email protected]> * Add Parallel() Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: mi11km <[email protected]> * add piped-handle-timeout(input args) Signed-off-by: mi11km <[email protected]> --------- Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Signed-off-by: moko-poi <[email protected]> * Increase limit of stale action operations (pipe-cd#4671) Signed-off-by: moko-poi <[email protected]> * Add docs for k8s annotations (pipe-cd#4673) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: moko-poi <[email protected]> * feat: add modifylisner and modifyrule Signed-off-by: moko-poi <[email protected]> * fix: ModifyRules Signed-off-by: moko-poi <[email protected]> * fix: rollback Signed-off-by: moko-poi <[email protected]> * fix: routing Signed-off-by: moko-poi <[email protected]> * fix: action.Type == elbtypes.ActionTypeEnumForward Signed-off-by: moko-poi <[email protected]> * fix: Update ModifyListeners and ModifyRules for Selective Action Modification Signed-off-by: moko-poi <[email protected]> --------- Signed-off-by: moko-poi <[email protected]> Signed-off-by: mi11km <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Masafumi Ikeyama <[email protected]> Co-authored-by: Kenta Kozuka <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #4530
Does this PR introduce a user-facing change?: