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

Issues with Max Length of kubernetes object #21

@J12934

Description

@J12934

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:

  1. Create a Scan with a name consisting of 63 chars.
  2. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions