-
Notifications
You must be signed in to change notification settings - Fork 61
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
[Feature]: API Client cannot create a duplicate route #178
Comments
Checks combination of host, path, domain guid and namespace is unique within the route namespace. Also moves the duplicate validator and error messages from workloads up a package level to webhooks Issue: #178
StatusOK -> StatusCreated as per spec Issue: #178 Co-authored-by: Kieron Browne <kbrowne@vmware.com>
This introduces a duplicate name helper for validating webhooks, to factor out common code between the app, org/space and new route webhooks. Route uniqueness is checked using a combination of host, path, domain guid and namespace within the route namespace. Note we are not using actual domain name as this could feasbily be changed on the domain, invalidating the name registry entry for the route. Also moves the duplicate validator and error messages from workloads up a package level to webhooks, so networking and workloads can share the code. There is no way to update route host/path/domain via the API, so we have an e2e test to trigger the update hook via the add destinations endpoint. This will exit the hook early as new and old route host/path/domain remain unchanged. Co-authored-by: Danail Branekov <danailster@gmail.com> Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io> Co-authored-by: Kieron Browne <kbrowne@vmware.com> Issue: #178
@davewalter, I have a couple of questions:
|
Food for thought: Unlike most resources, Domains in CF can't be updated. I know the CRs can right now, but if we found ways to make them "immutable-ish" that could help with those questions. https://v3-apidocs.cloudfoundry.org/version/3.115.0/index.html#update-a-domain |
It also seems impossible to update host, path and domain on a route via the API. So maybe they should be made immutable too. |
This introduces a duplicate name helper for validating webhooks, to factor out common code between the app, org/space and new route webhooks. Route uniqueness is checked using a combination of host, path, domain guid and namespace within the cf root namespace. Note we are not using actual domain name as this could feasbily be changed on the domain, invalidating the name registry entry for the route. We have introduced a config property to set the root CF namespace in the controllers config, and the various config yamls. We have also moved the duplicate validator and error messages from workloads up a package level to webhooks, so networking and workloads can share the code. There is no way to update route host/path/domain via the API, so we have an e2e test to trigger the update hook via the add destinations endpoint. This will exit the hook early as new and old route host/path/domain remain unchanged. Issue: #178 Co-authored-by: Danail Branekov <danailster@gmail.com> Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io> Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
This introduces a duplicate name helper for validating webhooks, to factor out common code between the app, org/space and new route webhooks. Route uniqueness is checked using a combination of host, path, domain guid and namespace within the cf root namespace. Note we are not using actual domain name as this could feasbily be changed on the domain, invalidating the name registry entry for the route. We have introduced a config property to set the root CF namespace in the controllers config, and the various config yamls. We have also moved the duplicate validator and error messages from workloads up a package level to webhooks, so networking and workloads can share the code. There is no way to update route host/path/domain via the API, so we have an e2e test to trigger the update hook via the add destinations endpoint. This will exit the hook early as new and old route host/path/domain remain unchanged. Issue: #178 Co-authored-by: Danail Branekov <danailster@gmail.com> Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io> Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
This adds a validating webhook to ensure the uniqueness of routes across all orgs and spaces. Since the name registry is used now in 3 webhooks: subnamespaceanchor, app and route, we factored out the common logic in a new DuplicateValidator helper. Route uniqueness is checked using a combination of host, path, domain guid and domain namespace within the cf root namespace. Note we are not using the actual domain name, as this should be immutable, and avoid an extra lookup. We have introduced a config property to set the root CF namespace in the controllers config, and the various config yamls, as we need to use a name registry in the root namespace to guarantee route uniqueness throughout all orgs and spaces. We have also moved the duplicate validator and error messages from workloads up a package level to webhooks, so networking and workloads can share the code. There is no way to update route host/path/domain via the API, so we have an e2e test to trigger the update hook via the add destinations endpoint. This will exit the hook early as new and old route host/path/domain remain unchanged. The code also fixes e2e flakiness by setting the non-propagation annotation on the cfdomain permissions workaround role binding. See #728 Issue: #178 Co-authored-by: Danail Branekov <danailster@gmail.com> Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io> Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
New validation webhook for route uniqueness
Blockers/Dependencies
No response
Background
As a client of the API shim
I want to receive an error when I attempt to create a duplicate route based on its FQDN + context path
So that I am prevented from creating a route if it already exists
Acceptance Criteria
With context path
GIVEN I have an existing route (e.g.
foo.example.com/bar
)WHEN I try to make another route with that same host, domain, and context path
THEN receive a
422
errorWithout context path
GIVEN I have an existing route (e.g.
foo.example.com
)WHEN I try to make another route with that same host and domain
THEN receive a
422
errorDev Notes
The text was updated successfully, but these errors were encountered: