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] Version command should not require a docker runtime #1514

Open
erikgb opened this issue Sep 18, 2024 · 0 comments
Open

[BUG] Version command should not require a docker runtime #1514

erikgb opened this issue Sep 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@erikgb
Copy link
Contributor

erikgb commented Sep 18, 2024

What did you do

We are building a container image with k3d installed. As part of the build pipeline, I want to do a lightweight test/verification of the k3d installation. When the pipeline had access to docker, both k3d --version and k3d version worked. But now I want to avoid having docker (or any other container runtime) available to the pipeline. But this does not seem to work:

$ k3d version
Failed to initialize: unable to resolve docker endpoint: open /certs/client/ca.pem: no such file or directory

The only reference to this path I can find is the environment variable DOCKER_CERT_PATH=/certs/client . I've been looking briefly at the k3d source code, and I suspect there might be something in the generic init applied to all commands:

k3d/cmd/root.go

Line 203 in 7f8ffd6

runtime, err := runtimes.GetRuntime("docker")

The container image has docker installed adding some DOCKER_* environment variables. As a workaround, I tried to unset all DOCKER_* environment variables before running the test (inside the image). And it works! But I think the k3d version should be independent of a Docker runtime present - regardless of docker environment variables present.

What did you expect to happen

The commands k3d --version and k3d version prints the versions as it should without errors.

Which version of k3d

v5.7.4

@erikgb erikgb added the bug Something isn't working label Sep 18, 2024
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

1 participant