woodpecker/pipeline/backend/kubernetes
Elias bffc9c8ff8
fix: can't run multiple services on k8s (#3395)
Fix Issue: https://github.com/woodpecker-ci/woodpecker/issues/3288

The way the pod service starts up makes it impossible to run two or more
pipelines at the same time when we have a service section.

The idea is to set the name of the service in the same way we did for
the pod name.

Pipeline: 

```yaml

services:
  mydb:
    image: mysql
    environment:
      - MYSQL_DATABASE=test
      - MYSQL_ROOT_PASSWORD=example
    ports:
      - 3306/tcp
steps:
  get-version:
    image: ubuntu
    commands:
      - ( apt update && apt dist-upgrade -y && apt install -y mysql-client 2>&1 )> /dev/null
      - sleep 30s # need to wait for mysql-server init
      - echo 'SHOW VARIABLES LIKE "version"' | mysql -uroot -hmydb test -pexample
```

Running more than one pipeline result:


![image](https://github.com/woodpecker-ci/woodpecker/assets/22245125/e512309f-0d1e-4125-bab9-2357a710fedd)

---------

Co-authored-by: elias.souza <elias.souza@quintoandar.com.br>
2024-02-17 12:30:06 +01:00
..
backend_options.go Parse backend options in backend (#3227) 2024-02-08 18:39:32 +01:00
backend_options_test.go Parse backend options in backend (#3227) 2024-02-08 18:39:32 +01:00
flags.go Flexible image pull secret reference (#3016) 2024-01-05 08:33:56 +01:00
kubernetes.go Fix linter (#3354) 2024-02-08 22:49:07 +01:00
kubernetes_test.go Secured kubernetes backend configuration (#3204) 2024-01-15 03:59:08 +01:00
pod.go fix: can't run multiple services on k8s (#3395) 2024-02-17 12:30:06 +01:00
pod_test.go fix: can't run multiple services on k8s (#3395) 2024-02-17 12:30:06 +01:00
service.go fix: can't run multiple services on k8s (#3395) 2024-02-17 12:30:06 +01:00
service_test.go fix: can't run multiple services on k8s (#3395) 2024-02-17 12:30:06 +01:00
utils.go Sanitize pod's step label (#3275) 2024-01-26 13:42:21 +01:00
utils_test.go Sanitize pod's step label (#3275) 2024-01-26 13:42:21 +01:00
volume.go Secured kubernetes backend configuration (#3204) 2024-01-15 03:59:08 +01:00
volume_test.go Secured kubernetes backend configuration (#3204) 2024-01-15 03:59:08 +01:00