From 930645dc6c98b91e9f47ea160aa6a55ef5cd5ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 19 Aug 2024 10:43:27 +0200 Subject: [PATCH 1/3] docs: document socket path on Windows --- docs/features/configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/features/configuration.md b/docs/features/configuration.md index aa5a0d0a61..d981c99412 100644 --- a/docs/features/configuration.md +++ b/docs/features/configuration.md @@ -110,3 +110,5 @@ Path to Docker's socket. Used by Ryuk, Docker Compose, and a few other container 6. Else, the default location of the docker socket is used: `/var/run/docker.sock` In any case, if the docker socket schema is `tcp://`, the default docker socket path will be returned. + +## Windows From 72f2420b969200d94f750e633087da86aa2f2d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 19 Aug 2024 12:24:16 +0200 Subject: [PATCH 2/3] chore: skip podman provider tests on Windows --- provider_test.go | 49 ++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/provider_test.go b/provider_test.go index 2448d84c07..7a63a96dd5 100644 --- a/provider_test.go +++ b/provider_test.go @@ -12,11 +12,12 @@ func TestProviderTypeGetProviderAutodetect(t *testing.T) { const podmanSocket = "unix://$XDG_RUNTIME_DIR/podman/podman.sock" tests := []struct { - name string - tr ProviderType - DockerHost string - want string - wantErr bool + name string + tr ProviderType + DockerHost string + want string + wantErr bool + skipOnWindows bool }{ { name: "default provider without podman.socket", @@ -25,10 +26,11 @@ func TestProviderTypeGetProviderAutodetect(t *testing.T) { want: Bridge, }, { - name: "default provider with podman.socket", - tr: ProviderDefault, - DockerHost: podmanSocket, - want: Podman, + name: "default provider with podman.socket", + tr: ProviderDefault, + DockerHost: podmanSocket, + want: Podman, + skipOnWindows: true, }, { name: "docker provider without podman.socket", @@ -38,27 +40,30 @@ func TestProviderTypeGetProviderAutodetect(t *testing.T) { }, { // Explicitly setting Docker provider should not be overridden by auto-detect - name: "docker provider with podman.socket", - tr: ProviderDocker, - DockerHost: podmanSocket, - want: Bridge, + name: "docker provider with podman.socket", + tr: ProviderDocker, + DockerHost: podmanSocket, + want: Bridge, + skipOnWindows: true, }, { - name: "Podman provider without podman.socket", - tr: ProviderPodman, - DockerHost: dockerHost, - want: Podman, + name: "Podman provider without podman.socket", + tr: ProviderPodman, + DockerHost: dockerHost, + want: Podman, + skipOnWindows: true, }, { - name: "Podman provider with podman.socket", - tr: ProviderPodman, - DockerHost: podmanSocket, - want: Podman, + name: "Podman provider with podman.socket", + tr: ProviderPodman, + DockerHost: podmanSocket, + want: Podman, + skipOnWindows: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if tt.tr == ProviderPodman && core.IsWindows() { + if tt.skipOnWindows && core.IsWindows() { t.Skip("Podman provider is not implemented for Windows") } From 7676025e43cef2f430d8565b0d6a6642c95b425d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 11 Sep 2024 17:38:34 +0200 Subject: [PATCH 3/3] fix: line endings for windows --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..dfdb8b771c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf