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

[Bug] soci cli fails if containerd address starts with "unix://" #880

Closed
ollypom opened this issue Oct 20, 2023 · 1 comment · Fixed by #934
Closed

[Bug] soci cli fails if containerd address starts with "unix://" #880

ollypom opened this issue Oct 20, 2023 · 1 comment · Fixed by #934
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ollypom
Copy link

ollypom commented Oct 20, 2023

Description

If the containerd address starts with unix:// the soci cli will fail. I stumbled upon this when I had a containerd address set in a nerdctl config file and was using the nerdctl image push --snapshotter soci command.

Steps to reproduce the bug

$ sudo soci --address="unix:///var/run/containerd/containerd.sock" index ls                                                                                                                            
soci: failed to dial "unix:///var/run/containerd/containerd.sock": failed to build resolver: invalid (non-empty) authority: unix:

$ sudo soci --address="/var/run/containerd/containerd.sock" index ls
DIGEST                                                                     SIZE    IMAGE REF                                                         PLATFORM       MEDIA TYPE                                    CREATED      
sha256:b8005edf213e3ef96bff588690c618a778adb88801db7acf9256b0bdd841b006    1211    111222333444.dkr.ecr.eu-west-1.amazonaws.com/nginxdemo2:latest    linux/amd64    application/vnd.oci.image.manifest.v1+json    4m24s ago

Where as on nerdctl

$ sudo nerdctl --address="/var/run/containerd/containerd.sock" ps
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES

$ sudo nerdctl --address="unix:///var/run/containerd/containerd.sock" ps                                                                                                                               
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES

Describe the results you expected

$ sudo soci --address="unix:///var/run/containerd/containerd.sock" index ls                                                                                                                            
DIGEST                                                                     SIZE    IMAGE REF                                                         PLATFORM       MEDIA TYPE                                    CREATED      
sha256:b8005edf213e3ef96bff588690c618a778adb88801db7acf9256b0bdd841b006    1211    111222333444.dkr.ecr.eu-west-1.amazonaws.com/nginxdemo2:latest    linux/amd64    application/vnd.oci.image.manifest.v1+json    4m24s ago

Host information

  1. OS: Amazon Linux 2
  2. Snapshotter Version: 0.4.0
  3. Containerd Version: 1.6.9

Any additional context or information about the bug

No response

@ollypom ollypom added the bug Something isn't working label Oct 20, 2023
@austinvazquez
Copy link
Contributor

Hi @ollypom! Thanks for reporting the issue. I have tracked the issue back to we can simply strip unix:// from the containerd address when creating the client (similar to nerdctl). As of v0.4.0, we have a dependency on containerd's ctr for this functionality [to create containerd client]. We have work in-progress to remove this dependency. (See #874)

Once #874 is complete, then it should be straightforward to add address := strings.TrimPrefix("unix://", context.GlobalString("address"), opts...) to achieve the desired behavior.

@github-project-automation github-project-automation bot moved this to ❓ Ungroomed in soci-snapshotter Oct 26, 2023
@Kern-- Kern-- moved this from ❓ Ungroomed to 📋 Backlog in soci-snapshotter Oct 26, 2023
@Kern-- Kern-- added the good first issue Good for newcomers label Oct 26, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in soci-snapshotter Nov 15, 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 good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants