"net/url"
"os"
"os/exec"
+ "path/filepath"
"strings"
"syscall"
f := flag.NewFlagSet(prog, flag.ContinueOnError)
f.SetOutput(stderr)
f.Usage = func() {
+ _, prog := filepath.Split(prog)
fmt.Fprint(stderr, prog+`: open an interactive shell on a running container.
Usage: `+prog+` [options] [username@]container-uuid [ssh-options] [remote-command [args...]]
f := flag.NewFlagSet(prog, flag.ContinueOnError)
f.SetOutput(stderr)
f.Usage = func() {
+ _, prog := filepath.Split(prog)
fmt.Fprint(stderr, prog+`: connect to the gateway service for a running container.
+NOTE: You almost certainly don't want to use this command directly. It
+is meant to be used internally. Use "arvados-client shell" instead.
+
Usage: `+prog+` [options] [username@]container-uuid
Options:
switch ctr.State {
case arvados.ContainerStateQueued, arvados.ContainerStateLocked:
- err = httpserver.ErrorWithStatus(fmt.Errorf("gateway is not available, container is %s", strings.ToLower(string(ctr.State))), http.StatusServiceUnavailable)
+ err = httpserver.ErrorWithStatus(fmt.Errorf("container is not running yet (state is %q)", ctr.State), http.StatusServiceUnavailable)
return
case arvados.ContainerStateRunning:
if ctr.GatewayAddress == "" {
- err = httpserver.ErrorWithStatus(errors.New("container is running but gateway is not available"), http.StatusServiceUnavailable)
+ err = httpserver.ErrorWithStatus(errors.New("container is running but gateway is not available -- installation problem or feature not supported"), http.StatusServiceUnavailable)
return
}
default:
- err = httpserver.ErrorWithStatus(fmt.Errorf("gateway is not available, container is %s", strings.ToLower(string(ctr.State))), http.StatusGone)
+ err = httpserver.ErrorWithStatus(fmt.Errorf("container has ended (state is %q)", ctr.State), http.StatusGone)
return
}
// crunch-run uses a self-signed / unverifiable TLS