Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When trying to set several ports in k8s, they must be named #2931

Closed
5 tasks done
allanger opened this issue Dec 11, 2023 · 0 comments
Closed
5 tasks done

When trying to set several ports in k8s, they must be named #2931

allanger opened this issue Dec 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@allanger
Copy link
Contributor

allanger commented Dec 11, 2023

Component

agent

Describe the bug

When you use kubernetes backend and need to have several ports exposed from a service, the pipeline is getting canceled (that is actually also not very obvious, because there is no error in UI, you can see it only when checking logs from the agent directly)

The error is caused by a requirement to have ports names if there are more than one. So this configuration won't work:

services:
  docker:
    image: docker:dind
    commands: dockerd -H tcp://0.0.0.0:2375 --tls=false
    privileged: true
    ports:
      - 2375
      - 16443

Error:

{"level":"error","error":"rpc error: code = Unknown desc = Step finished with exit code 1, Service \"wp-01hhdbk671qq8d5hewnmp98f3e-0-services-0\" is invalid: [spec.ports[0].name: Required value, spec.ports[1].name: Required value]","time":"2023-12-11T21:12:46Z","message":"grpc error: wait(): code: Unknown: rpc error: code = Unknown desc = Step finished with exit code 1, Service \"wp-01hhdbk671qq8d5hewnmp98f3e-0-services-0\" is invalid: [spec.ports[0].name: Required value, spec.ports[1].name: Required value]"}

I think that the easiest solution would be to give random names to ports, since they are used by woodpecker only, so k8s users should actually not care about them. Then the pipeline syntax won't have to be updated, and it won't be a breaking change. If this solution sounds reasonable, I can implement it myself.

UPD: Or put a port number to the port name too, I think it's even easier, we just need to make sure it's a string

System Info

I'm using Woodpecker 2.0.0 installed by the official helm chart.

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
  • Check that this is a concrete bug. For Q&A join our Discord Chat Server or the Matrix room.
@allanger allanger added the bug Something isn't working label Dec 11, 2023
6543 pushed a commit that referenced this issue Dec 19, 2023
It should cover this issue:  #2931

To sum up, when several ports need to be specified, they must be named
@6543 6543 closed this as completed Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants