RedHatInsights/bonfire

Bonfire is not able handle long name for namespace requestor

Closed this issue · 3 comments

I am working on a pr_check.sh and facing this error when github repo name is a bit longer:

15:35:02 The NamespaceReservation "bonfire-reservation-4e0f3a55" is invalid: metadata.labels: Invalid value: "RedHatInsights-insights-operator-gathering-conditions-service-pr-check-49": must be no more than 63 characters
15:35:02 
15:35:02 ERROR: namespace reserve: hit unexpected error:

This seems to be kubernetes limitation: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set

Could be implemented a trim mechanism for the labels to fit it into 63 characters? Rename github repo to be shorter is not an feasible option.

Or is there a workaround how to set the label name from pr_check.sh script?

The workaround for me is to override jenkins build name:

export JOB_NAME="SHORT_NAME"

You should be able to adjust the BONFIRE_NS_REQUESTER env var after you source bootstrap.sh: https://github.com/RedHatInsights/bonfire/blob/master/cicd/bootstrap.sh#L22

Assuming that the work-around given in last comment is enough to solve this and closing the issue, please re-open if needed.