File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,25 @@ func findPodmanSocket() (string, error) {
132132 logger .Debugf ("Failed to check Podman socket at %s: %v" , userSocketPath , err )
133133 }
134134
135+ // Check TMPDIR for Podman Machine API sockets (macOS)
136+ // The socket path follows the pattern: $TMPDIR/podman/<machine-name>-api.sock
137+ if tmpDir := os .Getenv ("TMPDIR" ); tmpDir != "" {
138+ podmanTmpDir := filepath .Join (tmpDir , "podman" )
139+ if _ , err := os .Stat (podmanTmpDir ); err == nil {
140+ // Look for any -api.sock files (there may be multiple machines)
141+ matches , err := filepath .Glob (filepath .Join (podmanTmpDir , "*-api.sock" ))
142+ if err == nil && len (matches ) > 0 {
143+ // Use the first available API socket
144+ socketPath := matches [0 ]
145+ logger .Debugf ("Found Podman machine API socket at %s" , socketPath )
146+ return socketPath , nil
147+ }
148+ logger .Debugf ("No Podman machine API sockets found in %s" , podmanTmpDir )
149+ } else {
150+ logger .Debugf ("Podman temp directory not found at %s: %v" , podmanTmpDir , err )
151+ }
152+ }
153+
135154 return "" , fmt .Errorf ("podman socket not found in standard locations" )
136155}
137156
You can’t perform that action at this time.
0 commit comments