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

Change ingress fetching to be isolated per provider #112

Conversation

LiorLieberman
Copy link
Member

@LiorLieberman LiorLieberman commented Dec 28, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
Currently we fetch all the ingresses in the main package and we pass them to all the providers.

This is not only redundant (as every provider only cares about its own ingresses) but also creates some bugs. (#109)

This also increases consistency as we already fetch CRDs at the provider level and store them in a local storage.

Note: This PR is likely to yield some more issues and TODOs that wont be addressed in this PR.
For example changing ToGatewayAPI interface function signature that wont need i2gw.InputResources anymore.
Another thing would be to revisit i2gw.InputResources struct and check if we need it or we will change it to just a list of Ingresses as it is the only things it holds now.

I structured the commits to ease the review so you could review each commit independently

Which issue(s) this PR fixes:
Fixes #109

Does this PR introduce a user-facing change?:

Move ingress fetching logic to be isolated, per provider

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 28, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiorLieberman

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

@k8s-ci-robot k8s-ci-robot requested a review from Xunzhuo December 28, 2023 14:59
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 28, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 28, 2023
@LiorLieberman
Copy link
Member Author

/label tide/merge-method-merge

/cc @dpasiukevich @levikobi @mlavacca

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges. label Dec 28, 2023
Also added issue numbers for TODOs
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 28, 2023

for _, f := range unstructuredObjects {
if !f.GroupVersionKind().Empty() && f.GroupVersionKind().Kind == "Ingress" {
var i networkingv1.Ingress
Copy link
Member

Choose a reason for hiding this comment

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

optional: i -> ingress

Usually i is associated with the iteration variable for index, ingress has more readability IMO.

pkg/i2gw/providers/istio/resource_reader.go Show resolved Hide resolved
@dpasiukevich
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 28, 2023
@dpasiukevich
Copy link
Member

dpasiukevich commented Dec 28, 2023

/hold

to ensure it's not automerged and there's another lgtm or approve

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 28, 2023
@k8s-ci-robot k8s-ci-robot merged commit ac068f8 into kubernetes-sigs:main Dec 28, 2023
5 checks passed
@levikobi
Copy link
Member

I too fell for it before @dpasiukevich 😅

@LiorLieberman
Copy link
Member Author

/cc @levikobi @mlavacca

@LiorLieberman
Copy link
Member Author

resolved all the comments here 835e917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate resources when using implementation-specific annotations
4 participants