* check source files for license header
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* tweak
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* add license header to all relevant source files
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
- Removed `getFreePort` as its use is always a race condition. Change
all uses of it to retrive the port after listening
- Added `getPortFrom` as a helper function to read a port from a stream
- Remove `Cluster.ownerRef` as it is outdated and no longer needed for 5.0
- Remove `Cluster.enabled`, no longer needed because of above
- Removed `Cluster.init`, moved its contents into `Cluster.constructor`
as nothing in that function is asyncronous. Currently only being run
on `main` as a stop gap until `renderer` gets its own version of
`Cluster`
- Refactored `LensProxy` so as to prevent `pty.node` (a NodeJS
extension) being included in `webpack.extension.ts`'s run
- Removed the passing around of the proxy port as that can now be
accessed from an instance of `LensProxy`
- purge ContextHandler's cache on disconnect
Co-authored-by: Sebastian Malton <sebastian@malton.name>
* Store prometheus metadata for clusters based on metrics requests
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Use ClusterMetadataKey.PROMETEHUS as key
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Update metadata only if it is changed
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Use structural comparer as default for store sync reaction
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* No need to compare metadata as json anymore
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Use structural comparer only in cluster-store
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Refactoring
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* React only prometeheus preference changes to re-initialise prometheus connection
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Add missing semicolons
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Fix imports
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Report metrics status in cluster-report (#1443)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Apply suggestions from code review
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
* Fix logger reference
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Roman <ixrock@gmail.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>
* fix format duration rounding days error
* added tests
Signed-off-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Signed-off-by: Jussi Nummelin <jussi.nummelin@gmail.com>
Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* Let OS allocate port number
Port availability might be tricky if some port is already in use on the
'all' interface '0.0.0.0'.
The proposed solution is to let the OS allocate the port for us using 0
as port specifier :
- first create a server instance to allocate a port number
- save port number
- close the server
- return the port number to the caller
This should be safe granted the OS doesn't reuse the port numbers on
consecutive port allocations.
see :
- about Node.js Net module : https://nodejs.org/docs/latest-v12.x/api/net.html#net_server_listen_port_host_backlog_callback
- about safety around reusing port number : https://unix.stackexchange.com/a/132524
Signed-off-by: Alexis Deruelle <alexis.deruelle@gmail.com>