[virtual-kubelet] Allow scheduling pods with name > 63 chars #3111
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.
Description
Fix #3093
As part of reflecting K8s pods, Liqo creates a new secret that holds the service account token from the consumer cluster. This secret has a particular label with the key "virtualkubelet.liqo.io/service-account-for-pod-name" and value of the original pod name. This causes an issue when the pod name is longer than 63 characters, where the resulting k8s secret cannot be created due to kubernetes limitations on max lenght of label values.
This artificially limits the size of pod names that can be reflected by Liqo to 63 instead of the 253 characters, which is allowed by Kubernetes.
This PR fixes the issue by changing how the secret is forged. Instead of relying on labels, the key is moved to annotations, which do NOT present any limitations on value length.