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

Validating Webhook does not respect namespace-level scoping #3336

Closed
lgadban opened this issue Jul 15, 2020 · 1 comment · Fixed by #3413
Closed

Validating Webhook does not respect namespace-level scoping #3336

lgadban opened this issue Jul 15, 2020 · 1 comment · Fixed by #3413
Assignees
Labels
Area: Helm Type: Bug Something isn't working

Comments

@lgadban
Copy link
Contributor

lgadban commented Jul 15, 2020

Describe the bug
The validating webhook will attempt to validate all gateway.solo.io resources from all namespaces, regardless of tenancy, namespace scoping, etc. The config for the webhook should respect the watchNamespace and the readGatewaysFromAllNamespaces (at the minimum, there may be other settings or knobs we need to consider)

To Reproduce
Install a 1.3 and 1.4 Gloo in two different namespaces, attempt to create a resource with feature that's only in 1.4, the 1.3 webhook will reject it

Expected behavior
Depending on the installation configs, the webhook should only validate resources for its specific gloo

Additional context
N/A

@lgadban lgadban added Type: Bug Something isn't working Area: Helm labels Jul 15, 2020
@mlholland mlholland self-assigned this Jul 23, 2020
@kdorosh
Copy link
Contributor

kdorosh commented Jul 23, 2020

As discussed offline, we actually already have functioning checks for watch namespaces: https://github.com/solo-io/gloo/blob/master/projects/gateway/pkg/services/k8sadmisssion/validating_admission_webhook.go#L215-L226

We need to add similar checks for readGatewaysFromAllNamespaces. A corner case where users have installed two different Gloos (1.3 and 1.4) where both watch all namespaces but don't read gateways from all namespaces has caused issues when trying to use 1.4 features on the 1.4 gateway.

In this setup it's on the user to ensure that virtual services/route tables and other config is valid for 1.3 and 1.4, as the watch namespaces for the gloo installation is still watching all resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Helm Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants