debugging

pull/7973/head
Sharif Elgamal 2020-05-20 14:19:50 -07:00
parent dd7e57e110
commit 43d37ec9f3
1 changed files with 2 additions and 0 deletions

View File

@ -104,6 +104,8 @@ func ForwardedPort(ociBin string, ociID string, contPort int) (int, error) {
return 0, errors.Wrapf(err, "get port %d for %q", contPort, ociID)
}
} else {
rr, err = runCmd(exec.Command(ociBin, "inspect", ociID))
fmt.Println(rr.Stdout.String())
rr, err = runCmd(exec.Command(ociBin, "inspect", "-f", fmt.Sprintf("'{{(index (index .NetworkSettings.Ports \"%d/tcp\") 0).HostPort}}'", contPort), ociID))
if err != nil {
return 0, errors.Wrapf(err, "get port %d for %q", contPort, ociID)