Debug getting mount points
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-07-28 20:18:18 +02:00
parent b9f6b37d1e
commit 0714b97213

View File

@@ -145,6 +145,8 @@ func getWorkDirPath(p Plugin, ctx context.Context) (string, string, error) {
return "", "", errors.Wrap(err, "failed to get our container id")
}
fmt.Fprintf(os.Stdout, "Container ID = %s\n", cntrId);
// Find the proper mount
cwd, err := os.Getwd()
if err != nil {
@@ -157,8 +159,10 @@ func getWorkDirPath(p Plugin, ctx context.Context) (string, string, error) {
if err != nil {
return "", "", errors.Wrap(err, "failed to inspect ourselves as a container")
}
fmt.Fprintf(os.Stdout, "Container = %+v\n", cntr);
fmt.Fprintf(os.Stdout, "Mounts = %+v\n", cntr.Mounts);
for _, i := range cntr.Mounts {
fmt.Fprintf(os.Stdout, "Source = %s Destination = %s\n", i.Source, i.Destination);
fmt.Fprintf(os.Stdout, "\tDestination = %s\n", i.Destination);
if i.Destination == cwd {
return i.Source, i.Destination, nil
}