Skip to content
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

[refactor] GW utils for all types of policies #134

Merged
merged 5 commits into from
Jan 13, 2023
Merged

Conversation

guicassolato
Copy link
Contributor

Preparation for #126.

  • Moves the functions to compute gw diffs and reconcile gateway back refs from the RateLimitPolicyReconciler to the base TargetRefReconciler
  • Moves the functions (NewGateways, SameGateways and LeftGateways) and GatewayWrapper type of the Gateway utils to pkg/common
  • Renames the GatewayWrapper type as TargetGateway
  • Makes all the above generic to it can be used with all types of policies

@guicassolato guicassolato self-assigned this Jan 11, 2023
@guicassolato guicassolato changed the title refactor: gateway utils made generic for all types of policies [refactor] GW utils for all types of policies Jan 11, 2023
…teways renamed as GatewaysMissingPolicyRef, GatewaysWithValidPolicyRef and GatewaysWithInvalidPolicyRef respectively
@guicassolato guicassolato force-pushed the refactor/gw-utils branch 2 times, most recently from 7df54dc to 7688fd1 Compare January 12, 2023 16:02
@guicassolato guicassolato marked this pull request as ready for review January 12, 2023 16:10
@guicassolato guicassolato requested a review from a team as a code owner January 12, 2023 16:10
@guicassolato guicassolato force-pushed the refactor/gw-utils branch 2 times, most recently from 3c843da to af8814c Compare January 12, 2023 16:14

gwKeys, err := r.TargetedGatewayKeys(ctx, policy.GetTargetRef(), policy.GetNamespace())
if err != nil {
return nil, err
Copy link
Contributor Author

@guicassolato guicassolato Jan 13, 2023

Choose a reason for hiding this comment

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

I think we should only return an error here if it's other than not found.

Copy link
Contributor

Choose a reason for hiding this comment

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

right. On NotFound error, it should return an empty list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants