Skip to content

Cleanup kubernetes versions when checking for host aliases and don't fail on parse error

What does this MR do?

Handles bad Kubernetes versions when checking for host aliases support.

Why was this MR needed?

GCP returns versions that our version package can't parse straight up. E.g. 1.14+. This MR attempts to get the digits before the first non-digit symbol and use them to check for a version, so 1.14+ is parsed as 1.14.

It also doesn't fail the whole job if we fail to parse a version. Since versions can be pretty wild there may be some edge cases we have missed. This way someone updating from GitLab runner 12.7 to 12.8 won't start seeing failing jobs across the board in the event we can't parse a Kubernetes version.

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

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Edited by Steve Xuereb

Merge request reports