Docker API client version bumped to 1.24 everywhere

This commit is contained in:
Raj Chaudhuri committed 2024-03-07 19:27:12 +05:30
1 parent 55a46992d4
commit e50040883f
12 files changed
+118 -27

No files matched your search

+16 -1
View File
@@ -2,7 +2,10 @@ package proxy
import (
"net/http"
"slices"
"strings"
docker "github.com/fsouza/go-dockerclient"
)
type createExecInterceptor struct{ proxy *Proxy }
@@ -18,7 +21,19 @@ func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {
return err
}
if _, hasWeaveWait := container.Volumes["/w"]; !hasWeaveWait {
// The .Volumes property seems to have been replaced with .Mounts in Docker
// API 1.20.
// .Volumes was a list, where the key was the mount path or destination
// .Mounts is an array of objects, where the .Destination property
// corresponds to the old .Volumes list key.
//
// if _, hasWeaveWait := container.Volumes["/w"]; !hasWeaveWait {
// return nil
// }
mountIndex := slices.IndexFunc(container.Mounts, func(m docker.Mount) bool {
return m.Destination == "/w"
})
if mountIndex == -1 {
return nil
}