diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..dfdb8b771c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/docs/features/configuration.md b/docs/features/configuration.md index ee5b6a4d69..3ae27c3b28 100644 --- a/docs/features/configuration.md +++ b/docs/features/configuration.md @@ -109,4 +109,8 @@ 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. + The library panics if the Docker host cannot be discovered. + +## Windows diff --git a/provider_test.go b/provider_test.go index 097c83a02c..e8a70d318b 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") }