[BREAKING CHANGE] root level kuadrant extensions - #78
Conversation
4def3f7 to
fc93631
Compare
|
cheers for verification steps, looks good: cat << EOF > openapi.yaml git:(openapi-kuadrant-extensions-at-root|⚑3)
---
openapi: "3.0.3"
info:
title: "Pet Store API"
version: "1.0.0"
x-kuadrant:
route:
name: "petstore"
namespace: "petstore-ns"
hostnames:
- example.com
parentRefs:
- name: gw
namespace: gw-ns
servers:
- url: https://example.io/v1
paths:
/cat:
x-kuadrant: ## Path level Kuadrant Extension
backendRefs:
- name: petstore
port: 80
namespace: petstore
get: # Added to the route and rate limited
operationId: "getCat"
responses:
405:
description: "invalid input"
/dog:
get: # Added to the route and rate limited
x-kuadrant: ## Operation level Kuadrant Extension
backendRefs:
- name: petstore
port: 80
namespace: petstore
operationId: "getDog"
responses:
405:
description: "invalid input"
EOF
➜ kuadrantctl git:(openapi-kuadrant-extensions-at-root -> upstream/openapi-kuadrant-extensions-at-root) ✗ cat openapi.yaml git:(openapi-kuadrant-extensions-at-root|…1⚑3
---
openapi: "3.0.3"
info:
title: "Pet Store API"
version: "1.0.0"
x-kuadrant:
route:
name: "petstore"
namespace: "petstore-ns"
hostnames:
- example.com
parentRefs:
- name: gw
namespace: gw-ns
servers:
- url: https://example.io/v1
paths:
/cat:
x-kuadrant: ## Path level Kuadrant Extension
backendRefs:
- name: petstore
port: 80
namespace: petstore
get: # Added to the route and rate limited
operationId: "getCat"
responses:
405:
description: "invalid input"
/dog:
get: # Added to the route and rate limited
x-kuadrant: ## Operation level Kuadrant Extension
backendRefs:
- name: petstore
port: 80
namespace: petstore
operationId: "getDog"
responses:
405:
description: "invalid input"
➜ kuadrantctl git:(openapi-kuadrant-extensions-at-root -> upstream/openapi-kuadrant-extensions-at-root) ✗ make install git:(openapi-kuadrant-extensions-at-root|…1⚑3
go fmt ./...
go vet ./...
GOBIN=/Users/jmadigan/Work/kuadrantctl/bin go install
➜ kuadrantctl git:(openapi-kuadrant-extensions-at-root -> upstream/openapi-kuadrant-extensions-at-root) ✗ bin/kuadrantctl generate gatewayapi httproute --oas openapi.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
creationTimestamp: null
name: petstore
namespace: petstore-ns
spec:
hostnames:
- example.com
parentRefs:
- name: gw
namespace: gw-ns
rules:
- backendRefs:
- name: petstore
namespace: petstore
port: 80
matches:
- method: GET
path:
type: Exact
value: /v1/cat
- backendRefs:
- name: petstore
namespace: petstore
port: 80
matches:
- method: GET
path:
type: Exact
value: /v1/dog
status:
parents: null |
jasonmadigan
left a comment
There was a problem hiding this comment.
Waiting on #77
Given the backwards compat change, we'll tag as 0.3.0?
Following semantic versioning rules, we can't. But it is not ready yet for v1.0.0, is it? I believe that v0.X.Y means alpha and braking changes can occur. So, semantic versioning should start on v1.X.Y. But whatever is fine with me |
| securitySchemes: | ||
| securedDog: | ||
| type: openIdConnect | ||
| openIdConnectUrl: https://example.com/.well-known/openid-configuration |
There was a problem hiding this comment.
I know it's for the test data, but as an example the value used here can be dangerous. Please refer to #76 (comment)
There was a problem hiding this comment.
to be clear, you are suggesting openIdConnectUrl in this example to be something like https://example.com and authorino (using go.oidc lib) will append automatically /.well-known/openid-configuration right?
Then, we need to document betterl that openIdConnectUrl and what value are expected. Out of scope of this PR, btw.
There was a problem hiding this comment.
Looks like @azgabur will land a fix for this example in https://github.com/Kuadrant/kuadrantctl/pull/76/files
| ## OpenAPI 3.0.X Kuadrant Extensions | ||
|
|
||
| ### Info level kuadrant extension | ||
| ### Root level kuadrant extension |
There was a problem hiding this comment.
I think this is a very welcome change. I always found it weird, having it under the info field.
Well done!
Yeah, you're right - I'd forgotten that everything in v0 in semver is considered unstable. Patch version bump probably fine. |
fc93631 to
58539d6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 0.38% 58.66% +58.27%
==========================================
Files 17 17
Lines 783 612 -171
==========================================
+ Hits 3 359 +356
+ Misses 780 181 -599
- Partials 0 72 +72 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What
[BREAKING CHANGE] Openapi info level kuadrant extensions moved to root level
Requires #77 first
Added some happy path tests
Verification Steps
The result should be