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

feat(validation): warn when KongIngress deprecated fields get populated #3261

Merged
merged 4 commits into from
Dec 15, 2022

Conversation

czeslavo
Copy link
Contributor

@czeslavo czeslavo commented Dec 14, 2022

What this PR does / why we need it:

  • reorganize admission.RequestHandler to make it more readable (add a method per handled type, add response builder and move the handler to a separate file)
  • add KongIngress validation returning warnings in case any of deprecated fields is populated

Which issue this PR fixes:

Fixes #3247.

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@czeslavo czeslavo added the area/feature New feature or request label Dec 14, 2022
@czeslavo czeslavo added this to the KIC v2.8.0 milestone Dec 14, 2022
@czeslavo czeslavo self-assigned this Dec 14, 2022
@czeslavo czeslavo marked this pull request as ready for review December 14, 2022 20:03
@czeslavo czeslavo requested a review from a team as a code owner December 14, 2022 20:03
internal/admission/handler.go Outdated Show resolved Hide resolved
internal/admission/handler.go Outdated Show resolved Hide resolved
test/integration/kongingress_webhook_test.go Outdated Show resolved Hide resolved
internal/admission/handler.go Outdated Show resolved Hide resolved
internal/admission/handler.go Outdated Show resolved Hide resolved
}
review.Response = response

if err := json.NewEncoder(w).Encode(&review); err != nil {

Check warning

Code scanning / CodeQL

Reflected cross-site scripting

Cross-site scripting vulnerability due to [user-provided value](1).
internal/admission/handler.go Show resolved Hide resolved
@czeslavo czeslavo enabled auto-merge (squash) December 15, 2022 12:25
@czeslavo czeslavo merged commit 595527b into main Dec 15, 2022
@czeslavo czeslavo deleted the feat/kong-ingress-webhook-warnings branch December 15, 2022 12:26
@pmalek
Copy link
Member

pmalek commented Dec 15, 2022

I resolved all the conversations and it auto merged 🤷 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/feature New feature or request size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admission webhook for KongIngress that warns about deprecation of certain fields
2 participants