Skip to content

Improve error handling and processing around release.yaml

Georgi N. Georgiev requested to merge improve-release-yaml-processing into master

From #147 (comment 1261318439):

When the Operator is started we get spec.template.spec.containers[0].image dynamically. At https://gitlab.com/gitlab-org/gl-openshift/gitlab-runner-operator/-/blob/master/controllers/runner/deployment.go#L15 we first check the config and if that's not set we try to use the image resolver which reads a release.yaml file from the root of the container: https://gitlab.com/gitlab-org/gl-openshift/gitlab-runner-operator/-/blob/master/controllers/runner/images.go#L99. This function is designed so it works in all environments for portability and testability and we've been using it since before GitLab Runner Operator has been a thing as it was ported from GitLab Operator AFAIK. I also see that getRelease has very poor error handling. Whether that's by design I don't know since that was ported as well I think, not to say I haven't touched this code but going through it line by line hasn't been something I have done. There's either some error that's being thrown somewhere in the code path or /run/secrets/kubernetes.io/serviceaccount does not exist.

Related to #147 (closed)

Edited by Georgi N. Georgiev

Merge request reports