This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Description
Describe the bug
The name of a kubernetes object cannot be longer than 63 chars.
When the length is exceeded a error is thrown and the object does not get created.
This can currently happen at multiple places. E.g. when a k8s job gets created to run the scan. it is prefixed with scan-. When the name of the scan was already near the 63 char limit, the scan cannot be executed as the operator cant create the job.
To Reproduce
Steps to reproduce the behavior:
- Create a Scan with a name consisting of 63 chars.
- Scan will fail as the name of the jobs will be rejected by the k8s api.
Expected behavior
The operator should truncate the name and add a random element by using k8s generateName field.
E.g:
# Scan Name: (63 chars)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# Scan k8s job name
scan-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-xdt66