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

fix(*): replace jsonschema validation with kube-openapi #5166

Merged
merged 6 commits into from
Oct 19, 2022

Conversation

lobkovilya
Copy link
Contributor

@lobkovilya lobkovilya commented Oct 18, 2022

Replace the library we're using for schema validation. It appears OpenAPI and JSONSchema are not exactly similar (different syntax for nullable). We should use OpenAPI validation. Luckily Kubernetes extracted the validation into a separate library kube-openapi so we can also use it.

Signed-off-by: Ilya Lobkov ilya.lobkov@konghq.com

Checklist prior to review

  • Link to docs PR or issue --
  • Link to UI issue or PR --
  • Is the issue worked on linked? --
  • The PR does not hardcode values that might break projects that depend on kuma (e.g. "kumahq" as a image registry) --
  • The PR will work for both Linux and Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Unit Tests --
  • E2E Tests --
  • Manual Universal Tests --
  • Manual Kubernetes Tests --
  • Do you need to update UPGRADE.md? -- No
  • Does it need to be backported according to the backporting policy? -- No
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

Changelog: feat(policy): reimplemented matching for new policies

@lobkovilya lobkovilya marked this pull request as ready for review October 18, 2022 11:26
@lobkovilya lobkovilya requested a review from a team as a code owner October 18, 2022 11:26
Copy link
Contributor

@lahabana lahabana left a comment

Choose a reason for hiding this comment

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

Should you add a test that exhibits the change in behaviour regarding nullable?

Copy link
Contributor

@slonka slonka left a comment

Choose a reason for hiding this comment

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

1 perf thing and agree with @lahabana that we should:

add a test that exhibits the change in behaviour regarding nullable

pkg/plugins/policies/validation/schema.go Outdated Show resolved Hide resolved
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>

# Conflicts:
#	go.mod
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
@lobkovilya lobkovilya merged commit 9d2034d into kumahq:master Oct 19, 2022
@lobkovilya lobkovilya deleted the fix/replace-schema-validator branch October 19, 2022 09:56
@lahabana lahabana mentioned this pull request Dec 13, 2022
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.

5 participants