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

isRunning fails when docker host responds with fully qualified image names #905

Closed
jgresty opened this issue Dec 6, 2023 · 4 comments
Closed
Assignees

Comments

@jgresty
Copy link

jgresty commented Dec 6, 2023

On some OCI hosts (eg podman), the get container call responds with a fully qualified name: eg docker.io/library/go-localstack:latest. This fails the equality check in isRunning which is expecting an unqualified name (eg go-localstack). As a result calls to Start* fail.

An easy fix would be:

-		if c.Image == imageName {
+		if strings.Contains(c.Image, imageName) {

however that may have false positives.

@elgohr
Copy link
Owner

elgohr commented Dec 6, 2023

Would be great to reproduce this within a test-run.
I guess you're running a self-hosted runner that has podman installed?

@jgresty
Copy link
Author

jgresty commented Dec 6, 2023

Steps to reproduce it:

  • install podman, enable podman.socket (systemctl start --user podman.socket)
  • set DOCKER_HOST to the above socket (eg DOCKER_HOST=unix:///run/user/1000/podman/podman.sock)
  • Try to start a localstack instance locally:
   opt, _ := localstack.WithClientFromEnv()
   l, _ := localstack.NewInstance(opt)
   if err := l.StartWithContext(ctx); err != nil {
       log.Fatalf("Could not start localstack %v", err)
   }

To capture this in a test case, it would either need to run with a podman host or the moby client would have to be mocked. Not sure if you want to complicate the current test setup by that extent just for this edge case.

@elgohr
Copy link
Owner

elgohr commented Dec 6, 2023

I guess we would need actions/runner#505 for this

@elgohr
Copy link
Owner

elgohr commented Dec 6, 2023

🤔 looks like podman is preinstalled already
https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#tools

elgohr added a commit that referenced this issue Dec 8, 2023
elgohr added a commit that referenced this issue Dec 25, 2023
@elgohr elgohr closed this as completed in 937bd66 Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants