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

Print generated GatewayClasses, TLSRoutes, TCPRoutes and ReferenceGrants. #110

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

dpasiukevich
Copy link
Member

@dpasiukevich dpasiukevich commented Dec 20, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Print generated GatewayClasses, TLSRoutes, TCPRoutes and ReferenceGrants.

These resources are already present in the provider conversion logic but are not propagated to the printer yet. The PR fixes this.

Which issue(s) this PR fixes:

Related to the #100. Istio provider would generate TLSRoutes, TCPRoutes and ReferenceGrants for users.

Does this PR introduce a user-facing change?:

Print generated GatewayClasses, TLSRoutes, TCPRoutes and ReferenceGrants in addition to Gateways and HTTPRoutes

@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 20, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 20, 2023
@dpasiukevich
Copy link
Member Author

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Dec 20, 2023
Comment on lines +88 to +97
for _, r := range gatewayResources {
resourceCount += len(r.GatewayClasses)
for _, gatewayClass := range r.GatewayClasses {
gatewayClass := gatewayClass
err := pr.resourcePrinter.PrintObj(&gatewayClass, os.Stdout)
if err != nil {
fmt.Printf("# Error printing %s GatewayClass: %v\n", gatewayClass.Name, err)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

It's just a nitpick, but is there any reason you repeated the outer for loop instead of having it once?

Copy link
Member Author

Choose a reason for hiding this comment

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

Kept the original logic: print all gateways from all providers, then all HTTPRoutes etc.

If it's in one loop, then the logic would change and we'd print all resources per provider.

Copy link
Member

Choose a reason for hiding this comment

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

100%

Copy link
Member

@levikobi levikobi left a comment

Choose a reason for hiding this comment

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

Thanks @dpasiukevich!
/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 20, 2023
@LiorLieberman
Copy link
Member

/assign
/cc

@LiorLieberman
Copy link
Member

Thanks @dpasiukevich !
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dpasiukevich, levikobi, 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 26, 2023
@k8s-ci-robot k8s-ci-robot merged commit 654e76f into kubernetes-sigs:main Dec 26, 2023
5 checks passed
xtineskim pushed a commit to xtineskim/ingress2gateway that referenced this pull request Jan 4, 2024
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. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants