Skip to content

Don't assign 'newToleration.Key = toleration' when toleration is blank

What does this MR do?

under this scenario, the ci job assignment will tolerate against any taint specified on any node (quote from official document An empty key with operator Exists matches all keys, values and effects which means this will tolerate everything.)

Why was this MR needed?

without this when starting the gitlab-runner with --kubernetes-node-tolerations :, gitlab-runner would throw the below error message

Registering runner... succeeded                     runner=sfjEF7P5
FATAL: Error encoding TOML: toml: Key 'runners.kubernetes.node_tolerations.' is not a valid table name. Key names cannot be empty.
Registration attempt 21 of 30
Runtime platform                                    arch=amd64 os=linux pid=290 revision=a8a019e0 version=12.3.0

Are there points in the code the reviewer needs to double check?

I discovered this bug while trying testing this MR (gitlab-org/charts/gitlab-runner!188 (merged)) for gitlab-runner helm charts (unfortunately I can't clone the gitlab-runner application repo with the same user, due to name conflict with the gitlab helm chart repo. Because I've already forked the gitlab-runner helm charts repo in my personal gitlab account, so I'm submitting this MR using my company's gitlab account)

Does this MR meet the acceptance criteria?

  • Documentation created/updated (not applicable, this is a bug fix)
  • Added tests for this feature/bug (not applicable, this is a bug fix)
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

don't think so at this stage, I searched for node tolerations in the issues (https://gitlab.com/gitlab-org/gitlab-runner/issues?scope=all&utf8=✓&state=opened&search=node+tolerations), don't find any issue that's related

Edited by 🤖 GitLab Bot 🤖

Merge request reports