Reflectors are created and run within the same function, asynchronously from the main thread.
Creating reflectors may require calls to the kubernetes api, which can return errors.
API errors are not handled in the main thread, but are handled asynchronously by retries.
Moving `deletePipe()` in `componentWillUnmount()` ensures the pipe is deleted when:
1. the terminal is closed
2. the terminal is closed when closing the pod panel
The pipe still does not get deleted when popping out the terminal.
Upgraded from 99c19923, branch release-3.0.
This required fetching or upgrading the following:
* k8s.io/api to kubernetes-1.9.1
* k8s.io/apimachinery to kubernetes-1.9.1
* github.com/juju/ratelimit to 1.0.1
* github.com/spf13/pflag to 4c012f6d
Also, update Scope's imports/function calls to be compatible with the new client.
This includes:
* an eBPF object built with a newer kernel (4.14)
* an increased threshold for guessing offsets, which is necessary for
the eBPF tracer to work on Google's Container-Optimized OS (used by
GKE)
* client: Fix uptime sort in table view
Duration dataType for table columns is now sorted as numeric value.
Default sorting is kept as ascending and text is left-aligned, unlike
numbers.
* Make non-second unit show up in tests
`isResourceSupported` checks whether a kubernetes resource is supported by the api server.
This ensures that, if the probe is unable to communicate with the api server, the call is retried until a true/false response.
If `isResourceSupported` returns false, `ListAndWatch` is not called and `runReflectorUntil` just exits.
This change makes the underlying reader set their corresponding `eof` slot to true on termination.
This make the overall logReadCloser converge to EOF in case of errors of the underlying readers, therefore prevent spinning on read.
`bufio.Reader.ReadBytes` may not return io.EOF when `Close()` closes the underlying reader.
For instance, closing logReadCloser from the Scope App makes `bufio.Reader.ReadBytes` produce the following error: `http2: response body closed`.
This isn't quite as neat as we'd want to make it, because two of the
three call sites still require a closure, but it's still an
improvement.
Note that every instance of MapEndpoints only ever maps to one
topology, which, furthermore, is a core report topology. Hence we can
just parameterise MapEndpoints with that topology, and then the map
functions can return just the node ids.