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

Webhook Validation is bypassed for existing resources when NKG starts #433

Closed
Tracked by #308
pleshakov opened this issue Feb 16, 2023 · 1 comment
Closed
Tracked by #308
Assignees
Labels
area/gateway/core Relates to all Core features of Gateway area/gatewayclass/core Relates to all Core features of GatewayClass area/httproute/core Relates to all Core features of HTTPRoute bug Something isn't working refined Requirements are refined and the issue is ready to be implemented.
Milestone

Comments

@pleshakov
Copy link
Contributor

pleshakov commented Feb 16, 2023

Describe the bug
Webhook Validation is bypassed for existing resources when NKG starts.
Note: the webhook validation running inside NKG process.

To Reproduce
Make sure Webhook is not installed, so that we test the webhook validation running inside NKG process.

  1. Create a resource that fails webhook validation.
  2. Deploy NKG
  3. See that NKG processes the resource.

Why? Because the resource is included in the first batch -- https://github.com/nginxinc/nginx-kubernetes-gateway/blob/13fc9a2428ee90648681abb22e08ef5f79d33e03/internal/events/loop.go#L92

Expected behavior

Validation is not bypassed.

Your environment

  • latest main branch

Aha! Link: https://nginx.aha.io/features/NKG-51

@pleshakov
Copy link
Contributor Author

this #416 will probably fix it

@pleshakov pleshakov added the bug Something isn't working label Mar 20, 2023
@kate-osborn kate-osborn added area/httproute/core Relates to all Core features of HTTPRoute area/gateway/core Relates to all Core features of Gateway area/gatewayclass/core Relates to all Core features of GatewayClass labels Mar 21, 2023
@kate-osborn kate-osborn added this to the v0.3.0 milestone Mar 21, 2023
@kate-osborn kate-osborn added the refined Requirements are refined and the issue is ready to be implemented. label Mar 24, 2023
pleshakov added a commit that referenced this issue Mar 30, 2023
- Move webhook validation code to the state package so that the package 
is responsible for enforcing it. As a result, it will not need require 
the users of that package to validate the supplied Gateway API
resources, which will make it easier to use the package and reduce
the number of possible bugs. Fixes
#416
- Fix Webhook Validation is bypassed for existing resources when NKG
starts. Fixes
#433
miledxz added a commit to miledxz/nginx-gateway-fabric that referenced this issue Jan 14, 2025
- Move webhook validation code to the state package so that the package 
is responsible for enforcing it. As a result, it will not need require 
the users of that package to validate the supplied Gateway API
resources, which will make it easier to use the package and reduce
the number of possible bugs. Fixes
nginx#416
- Fix Webhook Validation is bypassed for existing resources when NKG
starts. Fixes
nginx#433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway/core Relates to all Core features of Gateway area/gatewayclass/core Relates to all Core features of GatewayClass area/httproute/core Relates to all Core features of HTTPRoute bug Something isn't working refined Requirements are refined and the issue is ready to be implemented.
Projects
None yet
Development

No branches or pull requests

2 participants