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

Gateway spins up Ngrok CRDs #343

Merged
merged 46 commits into from
Mar 14, 2024
Merged

Conversation

Abdiramen
Copy link
Collaborator

@Abdiramen Abdiramen commented Feb 16, 2024

What

  • Expose flag for experimental Gateway API
  • Domains CRDs spun up by Gateway
  • HTTPSEdges spun up by HTTPRoute attached to a Gateway:
    • HTTPSEdgeRoute created on an HTTPSEdge corresponding to a HTTPRouteRule

How

  • Add flag to helm
  • plug Gateway into cachestore, store, and driver
  • plug HTTPRoute into cachestore, store, and driver

Breaking Changes

Nope, but the gateway currently just throws an error, and is prone to change!

@Abdiramen
Copy link
Collaborator Author

Abdiramen commented Feb 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Abdiramen and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added area/helm-chart Issues dealing with the helm chart area/controller Issues dealing with the controller labels Feb 16, 2024
@Abdiramen Abdiramen force-pushed the oz/set-experimental-gateway-flag branch 5 times, most recently from ce63e7b to 0433734 Compare February 21, 2024 21:40
@Abdiramen Abdiramen changed the title add experimetnal gateway flag Gateway spins up Ngrok CRDs Feb 21, 2024
@Abdiramen Abdiramen force-pushed the oz/set-experimental-gateway-flag branch from 47f2cf9 to 64e0b2c Compare February 22, 2024 14:31
@Abdiramen Abdiramen marked this pull request as ready for review February 22, 2024 20:19
@Abdiramen Abdiramen requested a review from a team as a code owner February 22, 2024 20:19
@Abdiramen Abdiramen force-pushed the oz/set-experimental-gateway-flag branch 2 times, most recently from d3d394d to 810522a Compare February 22, 2024 21:38
internal/store/driver.go Outdated Show resolved Hide resolved
internal/controller/utils/utils.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/controller/gateway/gateway_controller.go Outdated Show resolved Hide resolved
@Abdiramen Abdiramen force-pushed the oz/set-experimental-gateway-flag branch from 2c502b4 to 0ecef97 Compare March 14, 2024 15:01
@Abdiramen
Copy link
Collaborator Author

That driver nesting gets pretty deep, hopefully that can be decomposed to more functions in the future 😄

Agreed, we'll have to get to that after the first release!

Copy link
Contributor

@bobzilladev bobzilladev left a comment

Choose a reason for hiding this comment

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

my bits lgtm

Copy link
Contributor

@nikolay-ngrok nikolay-ngrok left a comment

Choose a reason for hiding this comment

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

a few comments 🤔

internal/store/store.go Outdated Show resolved Hide resolved
internal/store/driver.go Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
internal/store/driver.go Outdated Show resolved Hide resolved
@Abdiramen Abdiramen force-pushed the oz/set-experimental-gateway-flag branch from ea4f07d to 06b158b Compare March 14, 2024 17:53
@Abdiramen Abdiramen requested a review from nikolay-ngrok March 14, 2024 18:26
Copy link
Contributor

@nikolay-ngrok nikolay-ngrok left a comment

Choose a reason for hiding this comment

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

more comments 👍

if filter.Path == nil {
from := ".*" //"^https?://[^/]+(:[0-9]*)?(/[^\\?]*)?(\\?.*)?$"
to := fmt.Sprintf("%s://%s%s$uri", scheme, hostname, port)
err := d.createUrlRedirectConfig(from, to, requestHeaders, filter.StatusCode, actions)
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you can just do

return d.createUrlRedirectConfig(from, to, requestHeaders, filter.StatusCode, actions)

here 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

same further down 🤷

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll cut a new ticket to clean up the rest

d.log.Error(err, "cannot convert request redirect filter to json", "HTTPRequestRedirectFilter", urlRedirectAction)
return err
}
actions.endpointActions = append(
Copy link
Contributor

Choose a reason for hiding this comment

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

be great if we hide this behind Add 🤷

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll cut a new ticket to clean up the rest

case gatewayv1.HTTPRouteFilterExtensionRef:
return nil, errors.NewErrorNotFound(fmt.Sprintf("Unsupported filter HTTPRouteFilterType %v found", filter.Type))
default:
return nil, errors.NewErrorNotFound(fmt.Sprintf("Unknown filter HTTPRouteFilterType %v found", filter.Type))
Copy link
Contributor

Choose a reason for hiding this comment

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

errors.NewErrorNotFound doesn't seem quite appropriate here, wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll cut a new ticket to add new errors

}

if len(match.QueryParams) > 0 {
d.log.Error(fmt.Errorf("Unsupported match type"), "Unsupported match type", "HTTPQueryParamMatch", match.QueryParams)
Copy link
Contributor

Choose a reason for hiding this comment

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

should there return errors here? (and above)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, agreed, it should throw an error here.


for _, gtw := range gateways {
for _, listener := range gtw.Spec.Listeners {
if listener.Hostname == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, i'll add all of these to a follow up ticket

@Abdiramen Abdiramen merged commit a79a900 into main Mar 14, 2024
14 checks passed
@Abdiramen Abdiramen deleted the oz/set-experimental-gateway-flag branch March 14, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Issues dealing with the controller area/helm-chart Issues dealing with the helm chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants