-
Notifications
You must be signed in to change notification settings - Fork 6
test function definition validation in CI #9
test function definition validation in CI #9
Conversation
| openAPIV3Schema: | ||
| description: openAPIV3Schema is the OpenAPI v3 schema to use for validation | ||
| # kube-openapi validation doesn't support references, and inlining this ref is extremely tedious | ||
| # $ref: "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying from my other comment:
It appears that kube-openapi/validate.AgainstSchema doesn't support references and inlining this reference here will be a lot of tedious work, so I commented it out the reference.
Any errors in this field will be caught by lines 59-61 of tests/validate-metadata_test.go, which just tries to unmarshall the function metadata into the corresponding struct. The errors won't be as user-friendly as the errors caught by kube-openapi, but AFAICT it still catches most of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@natasha41575 I'd suggest filing an issue in upstream.
77c22f4 to
a0ecb3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mengqiy, natasha41575 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 |
Recreating #8 because the rebase made some things weird
This adds a CI check to validate the KRM function metadata based on the openapi schema of KRMFunctionDefinition as defined in the Catalog KEP. I can confirm that it works because it caught some of my mistakes in defining the render-helm-chart function definition
/cc @KnVerey
/cc @jeremyrickard
/cc @mengqiy