Unable to recognize `service.yaml` connection refused

Summary

Having a .gitlab-ci.yaml with 1 stage (deploy) and 2 concurrent jobs (staging and production), sometimes both pass. Sometimes they fail with:

error: unable to recognize "service.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp [::1]:8080: connect: connection refused

Steps to reproduce

Only happened on the first try. Couldn't reproduce with retries.

  1. Clone this project: https://gitlab.com/Alexand/concurrent-deploys
  2. Add an existing K8s cluster
  3. Install Helm
  4. Install Knative (domain name can be example.com)
  5. Run a pipeline. (one might need to run it several times since this is an intermittent problem)

Example Project

https://gitlab.com/Alexand/concurrent-deploys

What is the current bug behavior?

Both job failed on first try.

What is the expected correct behavior?

They should both always pass.

Relevant logs and/or screenshots

Screen_Shot_2019-07-16_at_4.55.59_PM

Output of checks

This bug happens on GitLab.com

Possible fixes

Since this only happened on the first try, could be something related to the Knative resource not being fully ready after the installation?

Edited by João Alexandre Cunha