Commit Graph

3932 Commits

Author SHA1 Message Date
Mike Lang
0e54b27e81 Don't omitempty for option group default value
The value "" is meaningful, and the UI does not behave correctly if it's not present.
2017-06-21 15:17:07 -07:00
Mike Lang
383ace4d7e Replace 'none' id for the none option in union types with ''
In union option groups, the list of selected ids is encoded as a comma-delimited string.
For example, if 'foo' and 'bar' are selected, the value 'foo,bar' is sent, ie ["foo", "bar"] -> "foo,bar"
Under this scheme, with nothing selected, the empty string should be sent, ie. [] -> ""

Before this change, the frontend code called the "none option" by id 'none'.
There were several issues with this:
* The frontend would send 'none' when nothing was selected, not ''. The backend ignored this as it ignores
  junk values in the options, treating them as though they hadn't been given.
* The backend would attempt to set the default value of an option to "nothing selected", ie. [], by sending ''.
  The frontend would interpret this as nothing selected, *not even the 'none' option*, which caused a visual bug.
* Everything would break if one of the legitimate options had the id 'none', which could easily happen eg.
  if a user had a 'none' k8s namespace. This is perhaps an unusual name, but our code shouldn't break when
  a particular arbitary string is used as an input.

With this change, the none option is called '', which fixes all the above problems:
* The frontend encodes [''] as ''
* The frontend decodes '' as [''], and therefore shows the '' option as selected
* The string '' is not a valid k8s namespace name and is a reasonable "prohibited value" for all other use cases.
  The backend already couldn't handle a value with this id correctly prior to this change anyway.
2017-06-21 15:03:18 -07:00
Matthias Radestock
6b8a0e47e5 Merge pull request #2631 from weaveworks/2630-correct-nodeSummaryGroupSpec
correct `nodeSummaryGroupSpec`
2017-06-21 19:13:36 +01:00
Matthias Radestock
ae2a5edc18 make nodeSummaryGroupSpecs only include what's needed 2017-06-21 18:24:14 +01:00
Matthias Radestock
b6c886e0d1 cosmetic 2017-06-21 18:19:10 +01:00
Roland Schilter
454bb8aa93 Merge pull request #2626 from weaveworks/use-go183
Use latest go1.8.3
2017-06-21 16:37:55 +02:00
Roland Schilter
c1b56c81b7 Use latest go1.8.3 2017-06-21 14:41:51 +02:00
Matthias Radestock
ef003d8a79 Merge pull request #2625 from weaveworks/fast-network-membership-check
fast network membership check
2017-06-21 12:45:12 +01:00
Alfonso Acosta
845592b008 Merge pull request #2621 from weaveworks/2576-go-1.8
Use Go 1.8
2017-06-21 11:59:30 +02:00
Matthias Radestock
a306867610 fast network membership check
The rendering code checks whether endpoint IPs are part of
cluster-local networks. Due to the prevalence of endpoints - medium
sized reports can contain many thousands of endpoints - this is
performance critical. Alas the existing code performs the check via a
linear scan of a list of networks. That is slow when there are more
than a few, which will be the case in the context of k8s, since there
the probes register service IPs as local /32 networks.

Here we change representation of the set of networks to a prefix
tree (aka trie), which is well-suited for IP network membership checks
since networks are in fact a bitstring prefixes.

The specific representation is a crit-bit tree, but that choice was
purely based on implementation convenience - the chosen library is the
only one I could find that directly supports IP networks.
2017-06-21 03:03:49 +01:00
Alfonso Acosta
d5ad391721 Add build-essential package 2017-06-20 20:09:50 +00:00
Matthias Radestock
9e75331e9a Revert "fast network membership check"
This reverts commit 98f036359b.
2017-06-20 20:51:27 +01:00
Matthias Radestock
4a54b75419 forgot this one in #2622 2017-06-20 20:43:26 +01:00
Matthias Radestock
98f036359b fast network membership check
The rendering code checks whether endpoint IPs are part of
cluster-local networks. Due to the prevalence of endpoints - medium
sized reports can contain many thousands of endpoints - this is
performance critical. Alas the existing code performs the check via a
linear scan of a list of networks. That is slow when there are more
than a few. Unfortunately in some common k8s network setups, e.g. on
AWS, a cluster can contain hundreds of networks, due to /32 networks
derived from interfaces with multiple IPs.

Here we change representation of the set of networks to a prefix
tree (aka trie), which is well-suited for IP network membership checks
since networks are in fact a bitstring prefixes.

The specific representation is a crit-bit tree, but that choice was
purely based on implementation convenience - the chosen library is the
only one I could find that directly supports IP networks.
2017-06-20 19:31:11 +01:00
Matthias Radestock
80c2b9d4f4 Merge pull request #2622 from weaveworks/ignore-ipv6
Ignore ipv6
2017-06-20 15:52:17 +01:00
Alfonso Acosta
1520444ab6 Use Go 1.8 2017-06-20 13:56:02 +00:00
Matthias Radestock
1ef56f6af6 refactor: extract common code 2017-06-20 12:03:02 +01:00
Matthias Radestock
7e5704b53b fix tests
...by removing them. It was a ridiculous amount of contorted code to
test some utterly trivial functionality that is largely provided by
the golang stdlib.
2017-06-20 12:03:02 +01:00
Filip Barl
eb64d3f09b Make API calls with time travel timestamp (#2600)
* Node details fetching reports at proper timestamp.

* Corrected all the relevant timestamps in the UI.

* Renamed some state variables.

* Time travel works for topologies list.

* Added a whole screen overlay for time travel.

* Polished the backend.

* Make time travel work also with the Resource View.

* Fixed the jest tests.

* Fixed the empty view message for resource view.

* Some naming polishing.

* Addressed the comments.
2017-06-20 12:31:22 +02:00
Matthias Radestock
4e0065a57d refactor: put all network detection code in one place 2017-06-20 09:23:52 +01:00
Matthias Radestock
19a6551de2 ignore local IPv6 addresses/networks
There is no point in paying attention to them since scope connection
tracking only deals in IPv4.
2017-06-20 09:04:08 +01:00
Matthias Radestock
5d6c965c47 Merge pull request #2617 from weaveworks/memoize-known-services
memoize isKnownServices for improved performance
2017-06-19 22:24:49 +01:00
Alfonso Acosta
43c5ed2aaf Merge pull request #2554 from weaveworks/never-localhost
Use 127.0.0.1 instead of localhost, more
2017-06-19 22:40:37 +02:00
Matthias Radestock
873fac12ac memoize isKnownServices for improved performance 2017-06-19 13:29:43 +01:00
Filip Barl
fd8f9be9cb Fix the table sorting order bug for numerical values (#2587)
* Fix the table sorting order bug for numerical values.

* Addressed @davkal's comment.
2017-06-19 12:42:33 +02:00
Alfonso Acosta
e42347addc Merge pull request #2590 from weaveworks/release-1.5
Release 1.5.0
2017-06-19 12:13:26 +02:00
Alfonso Acosta
a7076e6092 Update doc versions v1.5.0 2017-06-19 09:45:23 +00:00
Roland Schilter
debbb95cee Merge pull request #2605 from weaveworks/downgrade-d3transition-deps
Fix zoom for `npm start`
2017-06-19 10:59:05 +02:00
Matthias Radestock
b34cfe3f15 Merge pull request #2613 from weaveworks/faster-known-service-match
faster matching of known services
2017-06-19 09:47:21 +01:00
Alfonso Acosta
334d5714be Merge pull request #2582 from sjitech/user_namespace_aware
fix error when docker DAEMON is running with user namespace enabled.
2017-06-19 10:42:41 +02:00
Matthias Radestock
0d0414d348 faster matching of known services
We hit this code *a lot* during rendering.
2017-06-18 16:02:34 +01:00
Alfonso Acosta
8c0c20f289 Merge pull request #2604 from weaveworks/2577-ipv6-disabled-proc
Do not read tcp6 files if TCP version 6 isn't supported
2017-06-16 15:10:14 +02:00
Roland Schilter
64ba2b2a89 Fix zoom for npm start
Pins d3-transition and d3-drag dependencies which were previously
pulled in as deps from d3zoom as version 1.1.0 each. This broke
the zoom feature for `npm start`.

Fixes #2545
2017-06-15 23:29:15 +02:00
Alfonso Acosta
62f2c0920f Do not read tcp6 files if TCP version 6 isn't supported 2017-06-15 10:16:14 +00:00
Filip Barl
c4e0be45de Moved pause button back to footer. (#2585) 2017-06-14 11:39:45 +02:00
Filip Barl
0869d26ec4 Moved highlighted nodes/edges info to selectors (#2584)
* Use selector for highlighted nodes.

* Use selector for highlighted edges.
2017-06-14 11:11:59 +02:00
Filip Barl
83f557b638 Don't display the empty message when nodes are displayed. (#2597) 2017-06-14 11:03:54 +02:00
Roland Schilter
7cfef6d3f2 Merge pull request #2599 from weaveworks/bump-client-version-1.5
Bump client version in package.json
2017-06-14 08:33:47 +02:00
Roland Schilter
3ad629b797 Merge pull request #2593 from weaveworks/elide-url-passwords
Elide token-only credentials in cli arguments
2017-06-13 18:21:11 +02:00
Roland Schilter
8067ac93ae Bump client version in package.json 2017-06-13 16:40:45 +02:00
Roland Schilter
11355bbf4b Elide token-only credentials in cli arguments
Follow-up of #2568
2017-06-13 13:14:09 +02:00
Alfonso Acosta
16679849dc Release 1.5.0 2017-06-13 08:33:03 +00:00
Mike Lang
f403d01885 Forgot to include daemonsets in renderKubernetesTopologies
Yay, needing to remember 10 different obscure places to add a new topology every time.
2017-06-12 10:13:54 -07:00
Matthias Radestock
45aee2b2c4 Merge pull request #2581 from weaveworks/trim-endpoint-latest
drop addr and port from Endpoint.Latest map
2017-06-12 10:30:50 +01:00
Filip Barl
b6dfe25499 Time travel control (#2524)
* Hacky working prototype.

* Operate with time.Duration offset instead of fixed timestamp.

* Polished the backend code.

* Made a nicer UI component.

* Small refactorings of the websockets code.

* Fixed the backend tests.

* Better websocketing and smoother transitions

* Small styling refactoring.

* Detecting empty topologies.

* Improved error messaging.

* Addressed some of David's comments.

* Moved nodesDeltaBuffer to a global state to fix the paused status rendering bug.

* Small styling changes

* Changed the websocket global state variables a bit.

* Polishing & refactoring.

* More polishing.

* Final refactoring.

* Addressed a couple of bugs.

* Hidden the timeline control behind Cloud context and a feature flag.

* Addressed most of @davkal's comments.

* Added mixpanel tracking.
2017-06-12 11:22:17 +02:00
jjqq
8fa771e7d4 fix error when docker DAEMON is running with user namespace enabled.
1:mkdir: can't create directory '/var/run/scope/': Permission denied
2017-06-12 17:55:58 +09:00
Matthias Radestock
afbc1decab drop addr and port from Endpoint.Latest map
the information is constant and already present in the id, so we can
extract it from there.

That reduces the report size and improves report encoding/decoding
performance. It should reduce memory usage too and improve report
merging performance too.

NB: Probes with this change are incompatible with old apps.
2017-06-10 19:19:56 +01:00
Alfonso Acosta
70af2aac84 Merge pull request #2579 from weaveworks/2578-retarget-client
re-target app clients when name resolution changes
2017-06-09 15:05:39 +02:00
Matthias Radestock
c8f97878d2 re-target app clients when name resolution changes
Fixes #2578.
2017-06-09 12:30:26 +01:00
Matthias Radestock
fb735b65c4 cosmetic: correct comment 2017-06-09 11:31:20 +01:00