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

Invalid service name on Kubernetes #1232

Closed
4 tasks done
mmoya opened this issue Oct 4, 2022 · 0 comments · Fixed by #1234
Closed
4 tasks done

Invalid service name on Kubernetes #1232

mmoya opened this issue Oct 4, 2022 · 0 comments · Fixed by #1234
Labels
bug Something isn't working skip-changelog
Milestone

Comments

@mmoya
Copy link

mmoya commented Oct 4, 2022

Component

agent

Describe the bug

Woodpecker generates a prefix for kubernetes resources like 0-2156149869907855750. This can be used as prefix for a pvc name but it's an invalid prefix for services because "The name of a Service object must be a valid RFC1035 label name" (source).

The ci config:

services:
  docker:
    image: docker:22.06-rc-dind

pipeline:
  build:
    image: docker:22.06-rc-dind
    commands:
      - printenv | sort

The error:

default/woodpecker-woodpecker-agent-f485dddcf-bhlqb[woodpecker-agent]: {
  "level": "error",
  "error": "rpc error: code = Unknown desc = Proc finished with exitcode 1, Service \"0-2891002623454858384-services-0\" is invalid: [metadata.name: Invalid value: \"0-2891002623454858384-services-0\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), spec.ports: Required value]",
  "time": "2022-10-04T21:50:55Z",
  "message": "grpc error: wait(): code: Unknown: rpc error: code = Unknown desc = Proc finished with exitcode 1, Service \"0-2891002623454858384-services-0\" is invalid: [metadata.name: Invalid value: \"0-2891002623454858384-services-0\": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?'), spec.ports: Required value]"
}

System Info

{
  "source": "https://github.com/woodpecker-ci/woodpecker",
  "version": "next-612eee82"
}

Additional context

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working skip-changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants