-
Notifications
You must be signed in to change notification settings - Fork 14
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
Copy labels #44
Copy labels #44
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## httproute-kuadrant-extensions #44 +/- ##
================================================================
- Coverage 0.46% 0.46% -0.01%
================================================================
Files 15 15
Lines 643 650 +7
================================================================
Hits 3 3
- Misses 640 647 +7 ☔ View full report in Codecov by Sentry. |
Looking again.. after starting to now look at an RLP in an OAS spec. for backendRefs, I think all we're missing is the port. so maybe this is even simpler. This can stay a WIP until I figure out what changes (if any) we actually need! |
db3dd9f
to
08005b2
Compare
That first "custom rule" rules:
- backendRefs:
- name: petstore
port: 8080 is a catch all rule that will route all traffic to backend. Depending on the order that the catch-all rule lies in the final HTTPRoute, it could shadow all the remaining rules. |
Good contribution @jasonmadigan !! I am in for the Not sure, tho, about the "custom rules". The rule, consisting of the triple {matches, filters, backendrefs} is indeed not fully covered from the OAS doc. Only Is there a use case to add custom "matchers" to the HTTPRoute? Something that OAS does not cover? Maybe something like "when there is a header |
08005b2
to
84982bc
Compare
@eguzki updated so this just copies labels - removed the rules copying |
Copy
labels
It's kinda questionable how much we want to do here, but for a demonstration, I thought it would flow smoothly if the generated
HTTPRoute
included other things like rules and labels.You could stretch this further to copy any arbitrary items from the resource - I'm not sure how far we should go.
Sample OAS spec (from api-poc-petstore)
kuadrantctl generate gatewayapi httproute --oas src/main/resources/openapi.yaml | yq -P kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1beta1 metadata: name: petstore namespace: petstore creationTimestamp: null labels: deployment: petstore spec: parentRefs: - kind: Gateway namespace: kuadrant-multi-cluster-gateways name: prod-web hostnames: - petstore.example.com rules: - backendRefs: - name: petstore port: 8080 - matches: - path: type: PathPrefix value: /api/v3/user/login method: GET backendRefs: - name: petstore port: 8080 status: parents: null