Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Velero restores should work regardless of the length of the Restore name #1021
Create a restore from a backup with a long name defaults to a Restore name that's even longer:
ark restore describe k8s-dev-auth-namespace-backup-schedule-20181026050059-20181026153607
Ark restore applies labels to restored objects which includes the name of the restore the object is created from. Kubernetes label values must be less than 63 characters, and will be rejected if they are longer.
We ran into similar issues in Gimbal for replicating Services -- That solution is documented here: https://github.com/heptio/gimbal/blob/master/docs/discovery-naming-conventions.md#handling-discovered-names-that-are-longer-than-63-characters which might be of interest.
@nzoueidi to summarize this issue - Kubernetes object names have a maximum length of 253 characters. When Velero executes a restore, it adds a label,
We need to come up with a way to ensure that the label values have at most 63 characters, while still being able to represent objects with names of length up to 253 characters.
A couple ways we could do this:
Also note that there are likely additional places where this same issue is possible - we use object names as label value in multiple places. It would be best to address all of these, and in a consistent way.
A few references:
Yep, sorry for the delay. This is my approach, please correct me if I am mistaken.
Reading through this again, I think an approach similar to the one used in Gimbal (https://github.com/heptio/gimbal/blob/master/docs/discovery-naming-conventions.md#handling-discovered-names-that-are-longer-than-63-characters) makes sense. This would look something like:
@nzoueidi - Let's start by doing that for all labels that are applied in this function: https://github.com/heptio/velero/blob/master/pkg/restore/restore.go#L993