fix(kuma-cp): allow names of the resource to be longer and validate the length #6123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
kuma-cp
runs with Postgres database it allows the resource to have a name up to 100 characters. Kubernetes allows for most of the resources to have a length of 253 characters. There is the case that whenkuma-cp
runs in multizone deployment, during synchronization we are prefixing resource with the zone name and when the store is Kubernetes, we suffix resource name with the namespace name.Resource name pattern when synced to global:
zone-name.resource-name
zone-name.resource-name.namespace
Each element in the name has a different limit of character:
There are 4 cases:
To solve it I've increased the column size from 100 to 253 characters and added a check on API that validate that length of
zone-name.resource-name.default
is less than 253 characters. Because the only resources we synchronize from zone to global are the Dataplanes/ZoneEgress/ZoneIngress we don't need to check other namespaces. These resources can only be created in the default namespace. Another point to notice is that when running global on universal we are still checking for namespace because, on the zone level, we don't know what kind of database is running the global control-plane.syscall.Mkfifo
have equivalent implementation on the other OS --UPGRADE.md
? --> Changelog:
entry here or add aci/
label to run fewer/more tests?