forked from Ivasoft/github-actions
Debug search for working directory bind
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/drone-plugins/drone-github-actions/utils"
|
"github.com/drone-plugins/drone-github-actions/utils"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"time"
|
||||||
"github.com/opencontainers/selinux/go-selinux"
|
"github.com/opencontainers/selinux/go-selinux"
|
||||||
docker "github.com/docker/docker/client"
|
docker "github.com/docker/docker/client"
|
||||||
)
|
)
|
||||||
@@ -150,16 +151,21 @@ func getWorkDirPath(p Plugin, ctx context.Context) (string, string, error) {
|
|||||||
return "", "", errors.Wrap(err, "failed to locate the working directory in the container")
|
return "", "", errors.Wrap(err, "failed to locate the working directory in the container")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Fprintf(os.Stdout, "CWD = %s\n", cwd);
|
||||||
|
|
||||||
cntr, err := docker.ContainerInspect(ctx, cntrId)
|
cntr, err := docker.ContainerInspect(ctx, cntrId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", errors.Wrap(err, "failed to inspect ourselves as a container")
|
return "", "", errors.Wrap(err, "failed to inspect ourselves as a container")
|
||||||
}
|
}
|
||||||
for _, i := range cntr.Mounts {
|
for _, i := range cntr.Mounts {
|
||||||
|
fmt.Fprintf(os.Stdout, "Source = %s Destination = %s\n", i.Source, i.Destination);
|
||||||
if i.Destination == cwd {
|
if i.Destination == cwd {
|
||||||
return i.Source, i.Destination, nil
|
return i.Source, i.Destination, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(86400 * time.Second)
|
||||||
|
|
||||||
return "", "", errors.New("mount point with working directory not found")
|
return "", "", errors.New("mount point with working directory not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user