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

Pipeline stucks for kubernetes if image is invalid #3856

Closed
3 tasks done
zc-devs opened this issue Jun 29, 2024 · 8 comments · Fixed by #4007
Closed
3 tasks done

Pipeline stucks for kubernetes if image is invalid #3856

zc-devs opened this issue Jun 29, 2024 · 8 comments · Fixed by #4007
Labels
backend/kubernetes bug Something isn't working

Comments

@zc-devs
Copy link
Contributor

zc-devs commented Jun 29, 2024

Component

server

Describe the bug

When the one forgot commands directive, then they join to image => image cannot be pulled, pipeline stucks.

Steps to reproduce

  1. Create and run pipeline
skip_clone: true

when:
  - event:
      - manual

steps:
  hello:
    image: alpine
      - echo Hello
      - echo world
  1. See that it runs without errors and warnings
    Screenshot 2024-06-29 1
    Screenshot 2024-06-29 2
  2. Pipeline stucks until timed out or cancelled manually
  3. Check Pods and see errors
Error: InvalidImageName

Screenshot 2024-06-29 3

Failed to apply default image tag "alpine - echo Hello - echo world": couldn't parse image name "alpine - echo Hello - echo world": invalid reference format: repository name (library/alpine - echo Hello - echo world) must be lowercase

Screenshot 2024-06-29 4

Expected behavior

Pipeline should fail and linter should warn about missed commands as well.

System Info

`2.6.0`, Kubernetes

Additional context

woodpecker-server.log
woodpecker-agent.log

Validations

  • 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]
@zc-devs zc-devs added the bug Something isn't working label Jun 29, 2024
@zc-devs
Copy link
Contributor Author

zc-devs commented Jun 29, 2024

In regard Kubernets backend, probably, wider range of statuses should be hacked (#3580).

@zc-devs zc-devs changed the title Commands can leak into image Commands can leak into image, image cannot be pulled Jun 29, 2024
@qwerty287
Copy link
Contributor

Not sure, but this seems to be a yaml issue. AFAIK docker backend tells you if it fails to pull the image, or do you only specifically about kubernetes?

@zc-devs
Copy link
Contributor Author

zc-devs commented Jul 16, 2024

yaml issue

It is. It is only a part. Second is the Server's checks/linter. And third is Kube backend.

docker backend tells you if it fails to pull the image

Cool :) Kubernetes stucks.

do you only specifically about kubernetes?

There, where backend is meant, yes, I'm about Kubernetes backend, cause I have no other backends.


#3909 could have fixed the Server part. Schema is right, but there are no checks for commands and entrypoint steps.

@6543
Copy link
Member

6543 commented Jul 16, 2024

well your yaml is parsed:

skip_clone: true

when:
  - event:
      - 'manual'

steps:
  hello:
    image: 'alpine - echo Hello - echo world'

so the error that the image is invalid is fine!

how should the linter know if it is not a plugin and misses commands ?!?

@zc-devs
Copy link
Contributor Author

zc-devs commented Jul 16, 2024

the error that the image is invalid is fine!

Absolutely, if pipeline fails (third part).

how should the linter know if it is not a plugin and misses commands ?!?

I thought, that plugin uses settings. You are right:

"required": ["image"]

However, we check volume/pod/service names in Kube backend. Some regexp could be introduced for image check in the server.

@6543
Copy link
Member

6543 commented Jul 16, 2024

well that's an enhancement proposal :)

#3919

@zc-devs
Copy link
Contributor Author

zc-devs commented Jul 16, 2024

What about

Pipeline stucks until timed out or cancelled manually
In regard Kubernets backend, probably, wider range of statuses should be hacked (#3580).

?

What if I am just user without access to the cluster?

@6543 6543 reopened this Jul 16, 2024
@6543
Copy link
Member

6543 commented Jul 16, 2024

uh missed that, this is another issue!

@6543 6543 changed the title Commands can leak into image, image cannot be pulled Pipeline stucks for kubernetes if image is invalid Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/kubernetes bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants