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

feat: more Gateway API kind wrappers #16

Merged
merged 21 commits into from
Aug 22, 2024
Merged

Conversation

KevFan
Copy link
Contributor

@KevFan KevFan commented Aug 1, 2024

Description

Closes: #11

  • Adds wrappers the the following so they can be used in the topology as targetable / object / policy:

    • gateway.networking.k8s.io/v1

      • GRPCRoute (targetable)
    • gateway.networking.k8s.io/v1beta1

      • ReferenceGrant (object)
    • gateway.networking.k8s.io/v1alpha3

      • BackendTLSPolicy (policy)
    • gateway.networking.k8s.io/v1alpha2

      • TCPRoute (targetable)
      • TLSRoute (targetable)
      • UDPRoute (targetable)
      • BackendLBPolicy (policy)
    • v1 (core)

      • Namespace (targetable)
  • Additionally adds the LinkFunc's for the new xRoute kinds from above as part of the Gateway API Topology

    • These were not added to controller/topology_builder for now, unless we want to enable these already as part of the controller package?
    • The link function for Namespace as a targetable in the topolgy was not added as part of this PR as this seems not as straightforward which might require some deeper considerations such as:
      • Will Namespace be also a parent to Gateway since Gateway is namespace scoped? (i.e. Gateway will have both GatewayClass and Namespace as parents ). Who will take precedence in this case?
      • Namespace can be a parent of whatever the resource in its namespace which are also targetable, does this matter? i.e. a Route in a namespace may not have a Gateway since a Route can use a Gateway from a different namespace as a parent reference

one_of_each_kind

complex_not_expanded

with_section_name

complex

@KevFan KevFan changed the title [wip] Issues/11 [wip] feat: more Gateway API kind wrappers Aug 1, 2024
@KevFan KevFan force-pushed the issues/11 branch 3 times, most recently from 8c75a39 to a314211 Compare August 6, 2024 10:37
@KevFan KevFan changed the title [wip] feat: more Gateway API kind wrappers feat: more Gateway API kind wrappers Aug 6, 2024
@KevFan KevFan marked this pull request as ready for review August 6, 2024 13:57
httpRoute, ok := obj.(*gwapiv1.HTTPRoute)
if !ok {
return nil, false
}
return httpRoute, true
})

services := lo.FilterMap(lo.Values(objs[schema.GroupKind{Group: core.GroupName, Kind: "Service"}]), func(obj RuntimeObject, _ int) (*core.Service, bool) {
services := lo.FilterMap(lo.Values(objs[machinery.ServiceGroupKind]), func(obj RuntimeObject, _ int) (*core.Service, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also add the new types of resources here?

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 was originally thinking of just adding the new resource types to the machinary package, and once we feel it is stable/usable enough, we'll add it here then 🤔

Although I don't feel strongly about this if you prefer them to be added here also. Let me know 👍

@KevFan KevFan self-assigned this Aug 12, 2024
@KevFan
Copy link
Contributor Author

KevFan commented Aug 15, 2024

There seems to a failing unit test that I'll look into, for some reason the same test is passing locally but failing on the CI now 🤷

@KevFan KevFan force-pushed the issues/11 branch 2 times, most recently from a314211 to 2326be8 Compare August 15, 2024 15:14
@KevFan
Copy link
Contributor Author

KevFan commented Aug 16, 2024

Still looking into the unit test failure, it's failing locally for me now. Seems to an issue that surfaced after the new dot engine PR was merged. Service -> ServicePort is linked multiple times now on the graph for some reason 🤔

image

Copy link
Contributor

@guicassolato guicassolato left a comment

Choose a reason for hiding this comment

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

Left a minor suggestion only for completeness, but excellent work overall. Thanks!

@KevFan KevFan merged commit e963418 into Kuadrant:main Aug 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more Gateway API kind wrappers
3 participants