18790: Improve status update messages.
authorTom Clegg <tom@curii.com>
Mon, 10 Apr 2023 19:19:21 +0000 (15:19 -0400)
committerTom Clegg <tom@curii.com>
Mon, 10 Apr 2023 19:19:21 +0000 (15:19 -0400)
When container request UUID provided on command line, report initial
container UUID after looking it up (but without saying "connecting").

When first receiving acknowledgement from the API that it's possible
to receive logs from a container, report "connected, polling".

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

cmd/arvados-client/container_gateway.go

index b5f45199d6cb2e6eb44d6beb5dd1c27d4e9e71a0..9436959afd8cdadf2a949c7b6f73110d6bc49c0b 100644 (file)
@@ -70,11 +70,13 @@ func (lc *logsCommand) tailf(target string, stdout, stderr io.Writer, pollInterv
        if err != nil {
                return err
        }
+       if ctrUUID != target {
+               fmt.Fprintln(stderr, "target container UUID is", ctrUUID)
+       }
        err = lc.checkAPISupport(ctx, ctrUUID)
        if err != nil {
                return err
        }
-       fmt.Fprintln(stderr, "connecting to container", ctrUUID)
 
        var (
                // files to display
@@ -87,6 +89,9 @@ func (lc *logsCommand) tailf(target string, stdout, stderr io.Writer, pollInterv
                containerFinished = false
                // has anything worked? (if so, retry after errors)
                anySuccess = false
+               // container UUID that we most recently displayed in a
+               // "connected, polling" message (if any)
+               reportedConnection = ""
        )
 
 poll:
@@ -105,6 +110,10 @@ poll:
                                delay = pollInterval
                                continue poll
                        }
+                       if reportedConnection != ctrUUID {
+                               reportedConnection = ctrUUID
+                               fmt.Fprintln(stderr, "connected, polling for log data from container", ctrUUID)
+                       }
                        size[fnm] = currentsize
                        if oldsize, seen := mark[fnm]; !seen && currentsize > 10000 {
                                mark[fnm] = currentsize - 10000