133 Commits

Author SHA1 Message Date
Mikolaj Pawlikowski
114b39a970 Merge pull request #113 from bloomberg/seeker89-patch-1
Trying to get the GH actions right
2022-02-04 15:36:01 +00:00
Mikolaj Pawlikowski
00ca071c22 Remove the GO_MOD_ACTION
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 15:03:56 +00:00
Mikolaj Pawlikowski
0715e438b9 Always vendor
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 15:01:55 +00:00
Mikolaj Pawlikowski
c3a37636c3 Also dockerignore vendor folder
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 11:42:21 +00:00
Mikolaj Pawlikowski
5961c48854 Easier to read
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 11:39:00 +00:00
Mikolaj Pawlikowski
3f4d041c17 Dockerignore the bin folder
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 11:07:28 +00:00
Mikolaj Pawlikowski
9acc894fde Update publish.yml
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 11:06:12 +00:00
Mikolaj Pawlikowski
f1ee7f5a49 Merge pull request #112 from bloomberg/seeker89-patch-1
Fix the build badge
2022-02-04 10:56:09 +00:00
Mikolaj Pawlikowski
76f054ba50 Fix the build badge
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 10:51:43 +00:00
Mikolaj Pawlikowski
406f6e0ed0 Merge pull request #111 from bloomberg/seeker89-patch-1
Fix GH image publishing
2022-02-04 10:48:49 +00:00
Mikolaj Pawlikowski
b907f30c2f Update main.yml
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 10:44:59 +00:00
Mikolaj Pawlikowski
d304200ede Update publish.yml
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 10:43:56 +00:00
Mikolaj Pawlikowski
0755c8521f Merge pull request #110 from bloomberg/github-actions
Move onto Github Actions
2022-02-03 16:27:42 +00:00
Mikolaj Pawlikowski
9b1d8f8195 Run the docker image to see it works
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:34:56 +00:00
Mikolaj Pawlikowski
3cda043118 Cleanup the Makefile
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:33:06 +00:00
Mikolaj Pawlikowski
555709de0a Fix the tags and labels for the vendor build
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:28:49 +00:00
Mikolaj Pawlikowski
f89a07a420 Also do multi-arch builds on CI
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:27:30 +00:00
Mikolaj Pawlikowski
30f4d378f5 Delete Dockerfile-vendor
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:21:38 +00:00
Mikolaj Pawlikowski
b4ffe5dea2 Delete Dockerfile-simple
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:21:26 +00:00
Mikolaj Pawlikowski
42632de0cb Backwards compatible
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:17:50 +00:00
Mikolaj Pawlikowski
2f77502b0a Formatting
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:13:10 +00:00
Mikolaj Pawlikowski
46bc22ef0f Re-add basic CI with GH actions
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:12:07 +00:00
Mikolaj Pawlikowski
10277adc58 Update the secret names
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:09:58 +00:00
Mikolaj Pawlikowski
50ac3f0101 Delete .travis.yml
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:03:16 +00:00
Mikolaj Pawlikowski
56b438abad Delete docker_deploy.sh
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-03 12:02:37 +00:00
Mikolaj Pawlikowski
fcc30fbe75 Merge pull request #109 from mtougeron/multi-arch-build
[WORK IN PROGRESS] Multi-architecture builds for goldpinger
2022-02-03 11:58:43 +00:00
Mike Tougeron
6aee150cd0 Multi-arch builds for goldpinger
Signed-off-by: Mike Tougeron <tougeron@adobe.com>
2022-01-15 17:12:42 -08:00
Mikolaj Pawlikowski
f7509473f6 Merge pull request #108 from bloomberg/version3-3-0
Version 3.3.0
2021-11-09 17:00:10 +00:00
Mikolaj Pawlikowski
039362ff78 Version 3.3.0
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-11-09 16:53:05 +00:00
Mikolaj Pawlikowski
b5f352def1 Merge pull request #107 from rbtr/list-running-pods
only list running pods
2021-11-08 15:41:13 +00:00
Mikolaj Pawlikowski
842dfadeea Merge branch 'master' into list-running-pods 2021-11-08 15:11:18 +00:00
Mikolaj Pawlikowski
ba58fcfaa0 Merge pull request #106 from tyler-lloyd/tyler-lloyd/enable-ipv6
Enable ping traffic over IPv6 via @tyler-lloyd
2021-11-08 15:09:48 +00:00
Tyler Lloyd
34b78537c9 changed return type to IPFamily
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-08 09:38:38 -05:00
Tyler Lloyd
ae61217ead cleanup imports
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-05 10:41:29 -04:00
Tyler Lloyd
cfd26c8d26 changing to IP_VERSIONS
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-05 10:40:37 -04:00
Evan Baker
980a85b04d only list running pods
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2021-11-03 18:06:29 -05:00
Tyler Lloyd
b88d0f3ec5 don't use Sprintf for creating host address
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-03 16:58:38 -04:00
Tyler Lloyd
03dd6706b8 add node IP cache and change to get node
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-03 16:58:38 -04:00
Tyler Lloyd
f76b552c62 reverting to go 1.14
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-03 16:58:38 -04:00
Tyler Lloyd
5b080c7087 update readme for IPv6 example
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-03 16:58:38 -04:00
Tyler Lloyd
5d2070fad1 get pod and host IPv6 IPs when USE_IPV6 is set
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-03 16:58:38 -04:00
Tyler Lloyd
b35d40b7f2 bumping to go 1.16 and updating k8s packages
Signed-off-by: Tyler Lloyd <Tyler.Lloyd@microsoft.com>
2021-11-03 16:58:38 -04:00
Mikolaj Pawlikowski
294b8dda19 Merge pull request #101 from bloomberg/cluster-health
Add a /cluster_health endpoint
2021-03-22 13:26:32 +00:00
Mikolaj Pawlikowski
ed40304dd8 1 when healthy, 0 when unhealthy (bool, not return code)
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-19 14:45:58 +00:00
Mikolaj Pawlikowski
e6aa196232 Compare the actual host ips
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-19 14:26:07 +00:00
Mikolaj Pawlikowski
948b67a09b Break here, continue there
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-19 13:46:37 +00:00
Mikolaj Pawlikowski
d0e2e25ad2 Make it a bit more obvious
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-19 13:43:40 +00:00
Mikolaj Pawlikowski
8d5262d316 Make the naming a little less bad, remove the break statements
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-19 13:25:39 +00:00
Mikolaj Pawlikowski
407d201591 Add an overall metric goldpinger_cluster_health_total (pings + DNS check)
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-19 12:31:49 +00:00
Mikolaj Pawlikowski
1f5589db8c Simplify
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-16 17:24:56 +00:00
Mikolaj Pawlikowski
bc94f4e058 Forgot the set the default to true, if nothing bad happens
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-16 17:21:46 +00:00
Mikolaj Pawlikowski
634e04ec44 Handle the situation when one of the nodes returns an error
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 17:51:12 +00:00
Mikolaj Pawlikowski
13ae09d93e Compare all nodes return the expected nodes that Kubernetes returns
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 17:16:58 +00:00
Mikolaj Pawlikowski
52ff43ec7d Make it return 418 on cluster health problem
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 17:06:57 +00:00
Mikolaj Pawlikowski
bfc4603e45 Always return the DurationNs
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:38:32 +00:00
Mikolaj Pawlikowski
e4d0a6cdf7 Merge branch 'master' into cluster-health 2021-03-12 13:33:33 +00:00
Mikolaj Pawlikowski
ad828cf5a3 And implement it
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:31:39 +00:00
Mikolaj Pawlikowski
5d2ad6ce19 Also add a total number of nodes in a field for convenience
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:31:01 +00:00
Mikolaj Pawlikowski
1310f9b12b Add the generated at field
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:27:19 +00:00
Mikolaj Pawlikowski
f93526c58f Lint
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:27:07 +00:00
Mikolaj Pawlikowski
1f2f00ba35 First draft of implementing it
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:24:58 +00:00
Mikolaj Pawlikowski
807f193b07 Regenerate
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:06:26 +00:00
Mikolaj Pawlikowski
b0730e88df Actually, just keep it simple
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 13:05:53 +00:00
Mikolaj Pawlikowski
e827a8dc67 Regenearte the code
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 12:57:20 +00:00
Mikolaj Pawlikowski
c7a7008bf5 Separately for the pods and hosts
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 12:56:27 +00:00
Mikolaj Pawlikowski
3edecea467 Implement a stub of the new endpoint
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 12:24:42 +00:00
Mikolaj Pawlikowski
bd04fcbc58 Version v3.2.0
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 11:31:26 +00:00
Mikolaj Pawlikowski
3ff592b1e8 Re-generate using the latest swagger gen cli
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 11:30:53 +00:00
Mikolaj Pawlikowski
8f5c742aed Merge pull request #100 from bloomberg/v3.1.0
Bump up to v3.1.0
2021-03-12 11:22:11 +00:00
Mikolaj Pawlikowski
eb3113aa7f Add the schema for the new endpoint
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 11:21:02 +00:00
Mikolaj Pawlikowski
8865ae1411 Bump up to v3.1.0
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2021-03-12 11:07:55 +00:00
Mikolaj Pawlikowski
9ad2f6191a Merge pull request #98 from sethp-verica/feat/namespace-config
feat: configurable namespace for pod discovery
2021-03-12 11:05:36 +00:00
Seth Pellegrino
07ef524aed feat: configurable namespace for pod discovery
Adds a configuration option to allow for cross-namespace pings.

Signed-off-by: Seth Pellegrino <seth@verica.io>
2020-11-23 14:01:25 -08:00
Mikolaj Pawlikowski
ca676bcbc2 Merge pull request #91 from johscheuer/correct-readme
Correct example in the readme
2020-07-22 18:51:09 +01:00
Johannes M. Scheuermann
97ec159852 Correct example in the readme
Signed-off-by: Johannes M. Scheuermann <joh.scheuer@gmail.com>
2020-07-22 14:00:45 +02:00
Mikolaj Pawlikowski
bb1a72866d Merge pull request #89 from seeker89/readme3
Refresh the README
2020-06-10 22:30:13 +01:00
Mikolaj Pawlikowski
6e29c16148 Specify the size
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:24:17 +01:00
Mikolaj Pawlikowski
f83c1de387 MOAR hyperlinks
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:22:44 +01:00
Mikolaj Pawlikowski
e24f789b68 Hyperlink all the things
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:22:05 +01:00
Mikolaj Pawlikowski
3a922f4278 Some more polish
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:20:16 +01:00
Mikolaj Pawlikowski
24d74544e0 Well, I clearly don't know my emoticons
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:19:11 +01:00
Mikolaj Pawlikowski
28f7655170 Add a note about Chaos Engineering and the authors
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:17:28 +01:00
Mikolaj Pawlikowski
e9d3f8cd2b Refresh the readme a little bit
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-06-10 22:17:09 +01:00
Mikolaj Pawlikowski
857db0d523 Merge pull request #85 from bloomberg/seeker89-patch-1
Update examples and README to use v3.0.0 of Goldpinger
2020-05-08 13:09:18 +01:00
Mikolaj Pawlikowski
0260da795f Update example-with-kubeconfig.yaml
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-05-08 11:44:30 +01:00
Mikolaj Pawlikowski
4f8d872700 Update example-serviceaccounts.yml
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-05-08 11:44:30 +01:00
Mikolaj Pawlikowski
8790d3e7c4 Update README to use v3.0.0 of Goldpinger
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2020-05-08 11:44:30 +01:00
Mikolaj Pawlikowski
a77ad0c3c1 Merge pull request #83 from skamboj/calm-the-thundering-herd
Calm the thundering herd
2020-04-08 13:31:46 +01:00
Sachin Kamboj
7e60ee675a Simplify updateCounters, don't try to maintain a running count
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-08 07:56:04 -04:00
Sachin Kamboj
d68d35bbab Add a ping time that gives the last time a node was pinged
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 21:04:43 -04:00
Sachin Kamboj
2a78a9cec5 Don't ping all pods on call, return existing data
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 20:49:01 -04:00
Sachin Kamboj
9db241d67d Update the set of pingers at regular intervals from the k8s API server
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 19:54:19 -04:00
Sachin Kamboj
bc313a7fbb Merge branch 'master' into calm-the-thundering-herd 2020-04-07 14:18:09 -04:00
Mikolaj Pawlikowski
1a5d07b162 Merge pull request #82 from skamboj/better-logging
Better logging
2020-04-07 17:54:38 +01:00
Mikolaj Pawlikowski
131ea12745 Merge pull request #81 from skamboj/customize-timeouts
Customize timeouts
2020-04-07 14:40:22 +01:00
Sachin Kamboj
40f57b1a4e Get rid of the lock and keep a running count of healthy/unhealthy nodes
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 08:45:14 -04:00
Mikolaj Pawlikowski
d5dd96a419 Merge pull request #79 from skamboj/pod-name-instead-of-pod-ip
Pod name instead of pod ip
2020-04-07 13:38:21 +01:00
Sachin Kamboj
8a40aee927 Have the updater continuously ping pods and collate the results
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 08:02:36 -04:00
Sachin Kamboj
0690ac21a2 Command line options for adding a jitter-factor
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 07:55:48 -04:00
Sachin Kamboj
d0dfd3e493 Add code to continuously ping the pods and send the results over a channel
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-07 07:54:10 -04:00
Sachin Kamboj
cd5316bbb9 Allow debug logging
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 22:50:17 -04:00
Sachin Kamboj
9ae3e78035 Better structured logging
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 22:39:57 -04:00
Sachin Kamboj
2e1c799a25 Replace log statements with zap
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 22:18:04 -04:00
Sachin Kamboj
d33d6d6636 Update dependencies
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 22:17:24 -04:00
Sachin Kamboj
4a7a53603f Configure zap in main to do our logging
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 22:16:20 -04:00
Sachin Kamboj
e3942bd5eb Fix the crashing UI
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 20:33:25 -04:00
Sachin Kamboj
1c6362b2a9 Add a context to the ping results
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 19:43:22 -04:00
Sachin Kamboj
7bbdcacf9b Add a context/timeout to the heatmap
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 19:42:59 -04:00
Sachin Kamboj
3a6ab53ced Add a context to the updater
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 19:41:43 -04:00
Sachin Kamboj
aa7eaca30e Get the context from the request and add overall timeouts
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 19:38:32 -04:00
Sachin Kamboj
86f9f8a1dd Add a context and timeout to the ping and check calls
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 19:36:14 -04:00
Sachin Kamboj
c8fbf618c7 Add flags for custom timeouts for the three operations
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-06 19:32:47 -04:00
Sachin Kamboj
1338f28163 Increment the major version since this is a breaking change
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:31:05 -04:00
Sachin Kamboj
f0c66f29c7 Store results by pod name instead of pod IP
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:22:52 -04:00
Sachin Kamboj
86febf8295 Update the way of selecting pods
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:17:26 -04:00
Sachin Kamboj
aa789fdea8 Add a PodName to the config
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:16:43 -04:00
Sachin Kamboj
a95279ac8e Also remove the PodSelector from the config and main
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:13:53 -04:00
Sachin Kamboj
6ee538549a Simplify and remove the PodSelecter struct
There is currently only a single way to select pods to ping and there is really no way to conifgure alternatives. So this commit removes the struct and simplifes the code.

Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:11:53 -04:00
Sachin Kamboj
7fa3138235 Also store the PodName when fetching from k8s API server. Also map from podName to GoldpingerPod sruct
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:10:36 -04:00
Sachin Kamboj
00cd1e3886 Auto-generated code with the changes to the swagger
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:09:05 -04:00
Sachin Kamboj
4152784d21 Add a PodIP to the results now that we are using PodName as a key
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-03 23:00:48 -04:00
Mikolaj Pawlikowski
c66050e536 Merge pull request #78 from skamboj/migrate-to-go-modules
Migrate to go modules
2020-04-02 20:40:46 +01:00
Mikolaj Pawlikowski
34d84b233c Merge branch 'master' into migrate-to-go-modules 2020-04-02 17:56:00 +01:00
Mikolaj Pawlikowski
e07ae6a64c Merge pull request #75 from ifooth/master
fix prometheus ruler expr
2020-04-02 17:55:47 +01:00
Mikolaj Pawlikowski
6844a8d2b4 Merge branch 'master' into master 2020-04-02 17:36:43 +01:00
Sachin Kamboj
c23112de50 Update the CI
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 21:06:01 -04:00
Sachin Kamboj
436c1a7243 Update the README to remove references to dep
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 21:00:31 -04:00
Sachin Kamboj
66c8dc0cce Update the version/tag to be compatible with what go expects
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 20:53:45 -04:00
Sachin Kamboj
8a7e5a36ba Update the multistage build to use go 1.14 and go modules; Remove dep
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 20:26:03 -04:00
Sachin Kamboj
4e508cb8c8 Update the vendoring
Signed-off-by: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 20:17:37 -04:00
Sachin Kamboj
536a7ffbbb Remove the dep files
Signed-Off-By: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 20:16:47 -04:00
Sachin Kamboj
bf25a51c3e Add a go.mod and go.sum
Signed-Off-By: Sachin Kamboj <skamboj1@bloomberg.net>
2020-04-01 19:48:15 -04:00
Joe Lei
60436daf18 fix prometheus ruler expr
Signed-off-by: Joe Lei <thezero12@hotmail.com>
2020-02-18 10:59:43 +08:00
72 changed files with 3181 additions and 1386 deletions

View File

@@ -1 +1,3 @@
.git/
bin/
vendor/

55
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
# local build
- name: Compile the binary
run: |
make bin/goldpinger
./bin/goldpinger -h
# simple Docker build
- name: Build the Docker image
run: |
make build
docker run `make version` --help
# multi-arch build
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build regular image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: GO_MOD_ACTION=download
platforms: linux/amd64,linux/arm64
target: simple
- name: Build vendor image
id: docker_build_vendor
uses: docker/build-push-action@v2
with:
context: .
flavor: |
suffix: -vendor,onlatest=false
file: ./Dockerfile
build-args: GO_MOD_ACTION=vendor
platforms: linux/amd64,linux/arm64
target: vendor

57
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Publish
on:
push:
# Publish `v*` tags as releases.
tags:
- v*
pull_request:
jobs:
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: bloomberg/goldpinger
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: GO_MOD_ACTION=download
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: simple
- name: Build and push vendor
id: docker_build_vendor
uses: docker/build-push-action@v2
with:
context: .
flavor: |
suffix: -vendor,onlatest=false
file: ./Dockerfile
build-args: GO_MOD_ACTION=vendor
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: vendor

View File

@@ -1,40 +0,0 @@
language: go
services:
- docker
go:
- "1.10.x"
- master
script:
- docker --version
# dep
- go get -u github.com/golang/dep/cmd/dep
# build locally and run locally
- make clean && make vendor && make && ./bin/goldpinger --help
# build an image and run the image
- make clean && make vendor && make build
- docker images
- docker run `make version` --help
# build an image using the multistage builder
- make clean && make build-multistage
- docker images
- docker run `make version` --help
# build an image with the vendor folder
- make clean && make vendor && make vendor-build
- docker images
- docker run `make version`-vendor --help
deploy:
provider: script
script: bash docker_deploy.sh
skip_cleanup: true
on:
tags: true
go: "1.10.x"
condition: -n "$DOCKER_PASSWORD"

View File

@@ -1,24 +1,30 @@
FROM golang:1.11-alpine as builder
FROM golang:1.15-alpine as builder
ARG TARGETARCH
ARG TARGETOS
ENV GO111MODULE=on
# Install our build tools
RUN apk add --update git make bash
RUN go get -u github.com/golang/dep/cmd/dep
# Get dependencies
WORKDIR /go/src/github.com/bloomberg/goldpinger
COPY Gopkg.toml Gopkg.lock Makefile ./
RUN make vendor
WORKDIR /w
COPY go.mod go.sum ./
RUN go mod download
# Build goldpinger
COPY . ./
RUN make bin/goldpinger
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make bin/goldpinger
# Create vendor folder
RUN go mod vendor
# Build the asset container, copy over goldpinger
FROM scratch
COPY --from=builder /go/src/github.com/bloomberg/goldpinger/bin/goldpinger /goldpinger
FROM scratch as simple
COPY --from=builder /w/bin/goldpinger /goldpinger
COPY ./static /static
ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"]
ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"]
# For vendor builds, use the simple build and add the vendor'd files
FROM simple as vendor
COPY --from=builder /w/vendor /goldpinger-vendor-sources

670
Gopkg.lock generated
View File

@@ -1,670 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
digest = "1:d1665c44bd5db19aaee18d1b6233c99b0b9a986e8bccb24ef54747547a48027f"
name = "github.com/PuerkitoBio/purell"
packages = ["."]
pruneopts = "UT"
revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4"
version = "v1.1.0"
[[projects]]
branch = "master"
digest = "1:c739832d67eb1e9cc478a19cc1a1ccd78df0397bf8a32978b759152e205f644b"
name = "github.com/PuerkitoBio/urlesc"
packages = ["."]
pruneopts = "UT"
revision = "de5bf2ad457846296e2031421a34e2568e304e35"
[[projects]]
digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709"
name = "github.com/asaskevich/govalidator"
packages = ["."]
pruneopts = "UT"
revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f"
version = "v9"
[[projects]]
branch = "master"
digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d"
name = "github.com/beorn7/perks"
packages = ["quantile"]
pruneopts = "UT"
revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
[[projects]]
digest = "1:998cf998358a303ac2430c386ba3fd3398477d6013153d3c6e11432765cc9ae6"
name = "github.com/cespare/xxhash"
packages = ["."]
pruneopts = "UT"
revision = "3b82fb7d186719faeedd0c2864f868c74fbf79a1"
version = "v2.0.0"
[[projects]]
digest = "1:6f82cacd0af5921e99bf3f46748705239b36489464f4529a1589bc895764fb18"
name = "github.com/docker/go-units"
packages = ["."]
pruneopts = "UT"
revision = "47565b4f722fb6ceae66b95f853feed578a4a51c"
version = "v0.3.3"
[[projects]]
digest = "1:c45cef8e0074ea2f8176a051df38553ba997a3616f1ec2d35222b1cf9864881e"
name = "github.com/ghodss/yaml"
packages = ["."]
pruneopts = "UT"
revision = "73d445a93680fa1a78ae23a5839bad48f32ba1ee"
[[projects]]
branch = "master"
digest = "1:7fb51688eadf38272411852d7a2b3538c7caff53309abee6c0964a83c00fe69e"
name = "github.com/globalsign/mgo"
packages = [
"bson",
"internal/json",
]
pruneopts = "UT"
revision = "eeefdecb41b842af6dc652aaea4026e8403e62df"
[[projects]]
digest = "1:c49164b7b1e34324258ae61deef2cba7912005ba9cb7a9ee4930fe6bdfec7b5d"
name = "github.com/go-openapi/analysis"
packages = [
".",
"internal",
]
pruneopts = "UT"
revision = "c701774f4e604d952e4e8c56dee260be696e33c3"
version = "v0.17.2"
[[projects]]
digest = "1:ac4b35a4bba11edb2110fca0707bae03ae92fbd8222e6b483465d98efaabfb97"
name = "github.com/go-openapi/errors"
packages = ["."]
pruneopts = "UT"
revision = "d9664f9fab8994271e573ed69cf2adfc09b7a800"
version = "v0.17.2"
[[projects]]
digest = "1:953a2628e4c5c72856b53f5470ed5e071c55eccf943d798d42908102af2a610f"
name = "github.com/go-openapi/jsonpointer"
packages = ["."]
pruneopts = "UT"
revision = "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004"
version = "v0.17.2"
[[projects]]
digest = "1:81210e0af657a0fb3638932ec68e645236bceefa4c839823db0c4d918f080895"
name = "github.com/go-openapi/jsonreference"
packages = ["."]
pruneopts = "UT"
revision = "8483a886a90412cd6858df4ea3483dce9c8e35a3"
version = "v0.17.2"
[[projects]]
digest = "1:a20e8bf0e58e2010677432ffbe5533c1e83bdf368ba5b057f3e00e2071ca8b09"
name = "github.com/go-openapi/loads"
packages = ["."]
pruneopts = "UT"
revision = "150d36912387ec2f607be674c5be309ddccc0eed"
version = "v0.17.2"
[[projects]]
digest = "1:76b781f51e08cc0494b4abacf70d4b9da0a4732e270b7f2045ca9f0f875ad6d1"
name = "github.com/go-openapi/runtime"
packages = [
".",
"client",
"flagext",
"logger",
"middleware",
"middleware/denco",
"middleware/header",
"middleware/untyped",
"security",
]
pruneopts = "UT"
revision = "231d7876b7019dbcbfc97a7ba764379497b67c1d"
version = "v0.17.2"
[[projects]]
digest = "1:394fed5c0425fe01da3a34078adaa1682e4deaea6e5d232dde25c4034004c151"
name = "github.com/go-openapi/spec"
packages = ["."]
pruneopts = "UT"
revision = "5bae59e25b21498baea7f9d46e9c147ec106a42e"
version = "v0.17.2"
[[projects]]
digest = "1:ffa79f4705a3a85f2412d2d163c37acdf60d128c679e641c323a5de712e23d27"
name = "github.com/go-openapi/strfmt"
packages = ["."]
pruneopts = "UT"
revision = "edab9990ffc9b4a428f3306ecf4d18a069ca3317"
version = "v0.17.2"
[[projects]]
digest = "1:32f3d2e7f343de7263c550d696fb8a64d3c49d8df16b1ddfc8e80e1e4b3233ce"
name = "github.com/go-openapi/swag"
packages = ["."]
pruneopts = "UT"
revision = "5899d5c5e619fda5fa86e14795a835f473ca284c"
version = "v0.17.2"
[[projects]]
digest = "1:58541fddf3f4ec485710f1b346e7f647baf09a878a604e47e3668c600fe44076"
name = "github.com/go-openapi/validate"
packages = ["."]
pruneopts = "UT"
revision = "d2eab7d93009e9215fc85b2faa2c2f2a98c2af48"
version = "v0.17.2"
[[projects]]
digest = "1:f83d740263b44fdeef3e1bce6147b5d7283fcad1a693d39639be33993ecf3db1"
name = "github.com/gogo/protobuf"
packages = [
"proto",
"sortkeys",
]
pruneopts = "UT"
revision = "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
[[projects]]
digest = "1:2edd2416f89b4e841df0e4a78802ce14d2bc7ad79eba1a45986e39f0f8cb7d87"
name = "github.com/golang/glog"
packages = ["."]
pruneopts = "UT"
revision = "44145f04b68cf362d9c4df2182967c2275eaefed"
[[projects]]
digest = "1:4c0989ca0bcd10799064318923b9bc2db6b4d6338dd75f3f2d86c3511aaaf5cf"
name = "github.com/golang/protobuf"
packages = [
"proto",
"ptypes",
"ptypes/any",
"ptypes/duration",
"ptypes/timestamp",
]
pruneopts = "UT"
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
version = "v1.2.0"
[[projects]]
branch = "master"
digest = "1:0bfbe13936953a98ae3cfe8ed6670d396ad81edf069a806d2f6515d7bb6950df"
name = "github.com/google/btree"
packages = ["."]
pruneopts = "UT"
revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306"
[[projects]]
digest = "1:41bfd4219241b7f7d6e6fdb13fc712576f1337e68e6b895136283b76928fdd66"
name = "github.com/google/gofuzz"
packages = ["."]
pruneopts = "UT"
revision = "44d81051d367757e1c7c6a5a86423ece9afcf63c"
[[projects]]
digest = "1:75eb87381d25cc75212f52358df9c3a2719584eaa9685cd510ce28699122f39d"
name = "github.com/googleapis/gnostic"
packages = [
"OpenAPIv2",
"compiler",
"extensions",
]
pruneopts = "UT"
revision = "0c5108395e2debce0d731cf0287ddf7242066aba"
[[projects]]
digest = "1:878f0defa9b853f9acfaf4a162ba450a89d0050eff084f9fe7f5bd15948f172a"
name = "github.com/gregjones/httpcache"
packages = [
".",
"diskcache",
]
pruneopts = "UT"
revision = "787624de3eb7bd915c329cba748687a3b22666a6"
[[projects]]
digest = "1:3e260afa138eab6492b531a3b3d10ab4cb70512d423faa78b8949dec76e66a21"
name = "github.com/imdario/mergo"
packages = ["."]
pruneopts = "UT"
revision = "9316a62528ac99aaecb4e47eadd6dc8aa6533d58"
version = "v0.3.5"
[[projects]]
digest = "1:a2cff208d4759f6ba1b1cd228587b0a1869f95f22542ec9cd17fff64430113c7"
name = "github.com/jessevdk/go-flags"
packages = ["."]
pruneopts = "UT"
revision = "c6ca198ec95c841fdb89fc0de7496fed11ab854e"
version = "v1.4.0"
[[projects]]
digest = "1:bb3cc4c1b21ea18cfa4e3e47440fc74d316ab25b0cf42927e8c1274917bd9891"
name = "github.com/json-iterator/go"
packages = ["."]
pruneopts = "UT"
revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682"
[[projects]]
branch = "master"
digest = "1:84a5a2b67486d5d67060ac393aa255d05d24ed5ee41daecd5635ec22657b6492"
name = "github.com/mailru/easyjson"
packages = [
"buffer",
"jlexer",
"jwriter",
]
pruneopts = "UT"
revision = "60711f1a8329503b04e1c88535f419d0bb440bff"
[[projects]]
digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc"
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
pruneopts = "UT"
revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c"
version = "v1.0.1"
[[projects]]
digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318"
name = "github.com/mitchellh/mapstructure"
packages = ["."]
pruneopts = "UT"
revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe"
version = "v1.1.2"
[[projects]]
digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563"
name = "github.com/modern-go/concurrent"
packages = ["."]
pruneopts = "UT"
revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"
version = "1.0.3"
[[projects]]
digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855"
name = "github.com/modern-go/reflect2"
packages = ["."]
pruneopts = "UT"
revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
version = "1.0.1"
[[projects]]
branch = "master"
digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2"
name = "github.com/petar/GoLLRB"
packages = ["llrb"]
pruneopts = "UT"
revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4"
[[projects]]
digest = "1:0e7775ebbcf00d8dd28ac663614af924411c868dca3d5aa762af0fae3808d852"
name = "github.com/peterbourgon/diskv"
packages = ["."]
pruneopts = "UT"
revision = "5f041e8faa004a95c88a202771f4cc3e991971e6"
version = "v2.0.1"
[[projects]]
digest = "1:26663fafdea73a38075b07e8e9d82fc0056379d2be8bb4e13899e8fda7c7dd23"
name = "github.com/prometheus/client_golang"
packages = [
"prometheus",
"prometheus/internal",
"prometheus/promhttp",
]
pruneopts = "UT"
revision = "abad2d1bd44235a26707c172eab6bca5bf2dbad3"
version = "v0.9.1"
[[projects]]
branch = "master"
digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4"
name = "github.com/prometheus/client_model"
packages = ["go"]
pruneopts = "UT"
revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f"
[[projects]]
branch = "master"
digest = "1:db712fde5d12d6cdbdf14b777f0c230f4ff5ab0be8e35b239fc319953ed577a4"
name = "github.com/prometheus/common"
packages = [
"expfmt",
"internal/bitbucket.org/ww/goautoneg",
"model",
]
pruneopts = "UT"
revision = "7e9e6cabbd393fc208072eedef99188d0ce788b6"
[[projects]]
branch = "master"
digest = "1:ef74914912f99c79434d9c09658274678bc85080ebe3ab32bec3940ebce5e1fc"
name = "github.com/prometheus/procfs"
packages = [
".",
"internal/util",
"nfs",
"xfs",
]
pruneopts = "UT"
revision = "185b4288413d2a0dd0806f78c90dde719829e5ae"
[[projects]]
digest = "1:9424f440bba8f7508b69414634aef3b2b3a877e522d8a4624692412805407bb7"
name = "github.com/spf13/pflag"
packages = ["."]
pruneopts = "UT"
revision = "583c0c0531f06d5278b7d917446061adc344b5cd"
version = "v1.0.1"
[[projects]]
digest = "1:2731ee5852c26a3585f70d1a6cff8422383b98bad405eb6611cd4a2334be1df6"
name = "github.com/stuartnelson3/go-rendezvous"
packages = ["."]
pruneopts = "UT"
revision = "16dc0292e5f420d89a7dc4319775a1e5e461dc01"
version = "v0.2.0"
[[projects]]
digest = "1:3f3a05ae0b95893d90b9b3b5afdb79a9b3d96e4e36e099d841ae602e4aca0da8"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
pruneopts = "UT"
revision = "de0752318171da717af4ce24d0a2e8626afaeb11"
[[projects]]
branch = "master"
digest = "1:09c175055d303dadf3f82513c66e6da0b95ba22bc8e5d267a2674d16d95ea77a"
name = "golang.org/x/image"
packages = [
"font",
"font/basicfont",
"font/plan9font",
"math/fixed",
]
pruneopts = "UT"
revision = "31aff87c08e9a5e5d524279a564f96968336f886"
[[projects]]
branch = "master"
digest = "1:eb8583d4582ffbc5c6d3ec00132cd0835101edde42b6f24eaafa628d1596f881"
name = "golang.org/x/net"
packages = [
"context",
"http/httpguts",
"http2",
"http2/hpack",
"idna",
"netutil",
]
pruneopts = "UT"
revision = "10aee181995363b41f712a55844a0dd52ea04646"
[[projects]]
digest = "1:9359217acc6040b4be710ce34473acef28023ad39bfafecea34ffaea7f1e1890"
name = "golang.org/x/oauth2"
packages = [
".",
"internal",
]
pruneopts = "UT"
revision = "a6bd8cefa1811bd24b86f8902872e4e8225f74c4"
[[projects]]
branch = "master"
digest = "1:509feef845f6af582cb82caad5eb176016b30714facdc754d84869ca31305b59"
name = "golang.org/x/sys"
packages = [
"unix",
"windows",
]
pruneopts = "UT"
revision = "7155702f2d47d94b134229da97195d0130cab001"
[[projects]]
digest = "1:0c56024909189aee3364b7f21a95a27459f718aa7c199a5c111c36cfffd9eaef"
name = "golang.org/x/text"
packages = [
"collate",
"collate/build",
"internal/colltab",
"internal/gen",
"internal/tag",
"internal/triegen",
"internal/ucd",
"language",
"secure/bidirule",
"transform",
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable",
"width",
]
pruneopts = "UT"
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
version = "v0.3.0"
[[projects]]
digest = "1:d37b0ef2944431fe9e8ef35c6fffc8990d9e2ca300588df94a6890f3649ae365"
name = "golang.org/x/time"
packages = ["rate"]
pruneopts = "UT"
revision = "f51c12702a4d776e4c1fa9b0fabab841babae631"
[[projects]]
digest = "1:08206298775e5b462e6c0333f4471b44e63f1a70e42952b6ede4ecc9572281eb"
name = "google.golang.org/appengine"
packages = [
"internal",
"internal/base",
"internal/datastore",
"internal/log",
"internal/remote_api",
"internal/urlfetch",
"urlfetch",
]
pruneopts = "UT"
revision = "4a4468ece617fc8205e99368fa2200e9d1fad421"
version = "v1.3.0"
[[projects]]
digest = "1:ef72505cf098abdd34efeea032103377bec06abb61d8a06f002d5d296a4b1185"
name = "gopkg.in/inf.v0"
packages = ["."]
pruneopts = "UT"
revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"
version = "v0.9.0"
[[projects]]
digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = "UT"
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
version = "v2.2.1"
[[projects]]
digest = "1:910ec974550174f4ca48b9f4a3caec16b693e584c3762dc726dc0dcf28f8e318"
name = "k8s.io/api"
packages = [
"admissionregistration/v1alpha1",
"admissionregistration/v1beta1",
"apps/v1",
"apps/v1beta1",
"apps/v1beta2",
"authentication/v1",
"authentication/v1beta1",
"authorization/v1",
"authorization/v1beta1",
"autoscaling/v1",
"autoscaling/v2beta1",
"autoscaling/v2beta2",
"batch/v1",
"batch/v1beta1",
"batch/v2alpha1",
"certificates/v1beta1",
"coordination/v1beta1",
"core/v1",
"events/v1beta1",
"extensions/v1beta1",
"networking/v1",
"policy/v1beta1",
"rbac/v1",
"rbac/v1alpha1",
"rbac/v1beta1",
"scheduling/v1alpha1",
"scheduling/v1beta1",
"settings/v1alpha1",
"storage/v1",
"storage/v1alpha1",
"storage/v1beta1",
]
pruneopts = "UT"
revision = "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc"
version = "kubernetes-1.12.0"
[[projects]]
digest = "1:18f352651d6e8578fdbaf29c68334b042439b288b8ae4112c2b2ba9a6e35ced0"
name = "k8s.io/apimachinery"
packages = [
"pkg/api/errors",
"pkg/api/meta",
"pkg/api/resource",
"pkg/apis/meta/v1",
"pkg/apis/meta/v1/unstructured",
"pkg/apis/meta/v1beta1",
"pkg/conversion",
"pkg/conversion/queryparams",
"pkg/fields",
"pkg/labels",
"pkg/runtime",
"pkg/runtime/schema",
"pkg/runtime/serializer",
"pkg/runtime/serializer/json",
"pkg/runtime/serializer/protobuf",
"pkg/runtime/serializer/recognizer",
"pkg/runtime/serializer/streaming",
"pkg/runtime/serializer/versioning",
"pkg/selection",
"pkg/types",
"pkg/util/clock",
"pkg/util/errors",
"pkg/util/framer",
"pkg/util/intstr",
"pkg/util/json",
"pkg/util/naming",
"pkg/util/net",
"pkg/util/runtime",
"pkg/util/sets",
"pkg/util/validation",
"pkg/util/validation/field",
"pkg/util/yaml",
"pkg/version",
"pkg/watch",
"third_party/forked/golang/reflect",
]
pruneopts = "UT"
revision = "6dd46049f39503a1fc8d65de4bd566829e95faff"
version = "kubernetes-1.12.0"
[[projects]]
digest = "1:51fd9ac9f2be10d79f5af101a7a1d758ef283fdb028a0d11198754bd3d4a6020"
name = "k8s.io/client-go"
packages = [
"discovery",
"kubernetes",
"kubernetes/scheme",
"kubernetes/typed/admissionregistration/v1alpha1",
"kubernetes/typed/admissionregistration/v1beta1",
"kubernetes/typed/apps/v1",
"kubernetes/typed/apps/v1beta1",
"kubernetes/typed/apps/v1beta2",
"kubernetes/typed/authentication/v1",
"kubernetes/typed/authentication/v1beta1",
"kubernetes/typed/authorization/v1",
"kubernetes/typed/authorization/v1beta1",
"kubernetes/typed/autoscaling/v1",
"kubernetes/typed/autoscaling/v2beta1",
"kubernetes/typed/autoscaling/v2beta2",
"kubernetes/typed/batch/v1",
"kubernetes/typed/batch/v1beta1",
"kubernetes/typed/batch/v2alpha1",
"kubernetes/typed/certificates/v1beta1",
"kubernetes/typed/coordination/v1beta1",
"kubernetes/typed/core/v1",
"kubernetes/typed/events/v1beta1",
"kubernetes/typed/extensions/v1beta1",
"kubernetes/typed/networking/v1",
"kubernetes/typed/policy/v1beta1",
"kubernetes/typed/rbac/v1",
"kubernetes/typed/rbac/v1alpha1",
"kubernetes/typed/rbac/v1beta1",
"kubernetes/typed/scheduling/v1alpha1",
"kubernetes/typed/scheduling/v1beta1",
"kubernetes/typed/settings/v1alpha1",
"kubernetes/typed/storage/v1",
"kubernetes/typed/storage/v1alpha1",
"kubernetes/typed/storage/v1beta1",
"pkg/apis/clientauthentication",
"pkg/apis/clientauthentication/v1alpha1",
"pkg/apis/clientauthentication/v1beta1",
"pkg/version",
"plugin/pkg/client/auth/exec",
"rest",
"rest/watch",
"tools/auth",
"tools/clientcmd",
"tools/clientcmd/api",
"tools/clientcmd/api/latest",
"tools/clientcmd/api/v1",
"tools/metrics",
"tools/reference",
"transport",
"util/cert",
"util/connrotation",
"util/flowcontrol",
"util/homedir",
"util/integer",
]
pruneopts = "UT"
revision = "1638f8970cefaa404ff3a62950f88b08292b2696"
version = "v9.0.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
input-imports = [
"github.com/cespare/xxhash",
"github.com/go-openapi/errors",
"github.com/go-openapi/loads",
"github.com/go-openapi/runtime",
"github.com/go-openapi/runtime/client",
"github.com/go-openapi/runtime/flagext",
"github.com/go-openapi/runtime/middleware",
"github.com/go-openapi/runtime/security",
"github.com/go-openapi/spec",
"github.com/go-openapi/strfmt",
"github.com/go-openapi/swag",
"github.com/go-openapi/validate",
"github.com/jessevdk/go-flags",
"github.com/prometheus/client_golang/prometheus",
"github.com/prometheus/client_golang/prometheus/promhttp",
"github.com/stuartnelson3/go-rendezvous",
"golang.org/x/image/font",
"golang.org/x/image/font/basicfont",
"golang.org/x/image/math/fixed",
"golang.org/x/net/netutil",
"k8s.io/apimachinery/pkg/apis/meta/v1",
"k8s.io/client-go/kubernetes",
"k8s.io/client-go/rest",
"k8s.io/client-go/tools/clientcmd",
]
solver-name = "gps-cdcl"
solver-version = 1

View File

@@ -1,82 +0,0 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/go-openapi/errors"
version = "0.17.2"
[[constraint]]
name = "github.com/go-openapi/loads"
version = "0.17.2"
[[constraint]]
name = "github.com/go-openapi/runtime"
version = "0.17.2"
[[constraint]]
name = "github.com/go-openapi/spec"
version = "0.17.2"
[[constraint]]
name = "github.com/go-openapi/strfmt"
version = "0.17.2"
[[constraint]]
name = "github.com/go-openapi/swag"
version = "0.17.2"
[[constraint]]
name = "github.com/go-openapi/validate"
version = "0.17.2"
[[constraint]]
name = "github.com/jessevdk/go-flags"
version = "1.4.0"
[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.9.1"
[[constraint]]
branch = "master"
name = "golang.org/x/net"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.12.0"
[[constraint]]
name = "k8s.io/client-go"
version = "9.0.0"
[[constraint]]
name = "github.com/stuartnelson3/go-rendezvous"
version = "0.2.0"
[prune]
go-tests = true
unused-packages = true

View File

@@ -1,15 +1,16 @@
name ?= goldpinger
version ?= 2.0.2
version ?= v3.4.0
bin ?= goldpinger
pkg ?= "github.com/bloomberg/goldpinger"
tag = $(name):$(version)
goos ?= ${GOOS}
goarch ?= ${GOARCH}
namespace ?= "bloomberg/"
files = $(shell find . -iname "*.go")
bin/$(bin): $(files)
GOOS=${goos} PKG=${pkg} ARCH=amd64 VERSION=${version} BIN=${bin} ./build/build.sh
GOOS=${goos} PKG=${pkg} ARCH=${goarch} VERSION=${version} BIN=${bin} ./build/build.sh
clean:
rm -rf ./vendor
@@ -17,40 +18,28 @@ clean:
vendor:
rm -rf ./vendor
dep ensure -v -vendor-only
go mod vendor
# Download the latest swagger releases from: https://github.com/go-swagger/go-swagger/releases/
swagger:
swagger generate server -t pkg -f ./swagger.yml --exclude-main -A goldpinger && \
swagger generate client -t pkg -f ./swagger.yml -A goldpinger
build-multistage:
docker build -t $(tag) -f ./Dockerfile .
build: GOOS=linux
build: bin/$(bin)
docker build -t $(tag) -f ./build/Dockerfile-simple .
tag:
docker tag $(tag) $(namespace)$(tag)
push:
docker push $(namespace)$(tag)
run:
go run ./cmd/goldpinger/main.go
build:
docker build -t $(namespace)$(tag) --target simple -f ./Dockerfile .
build-vendor:
docker build -t $(namespace)$(tag)-vendor --target vendor -f ./Dockerfile .
build-release:
docker buildx build --push --platform linux/amd64,linux/arm64 --target simple -t $(namespace)$(tag) -f ./Dockerfile .
docker buildx build --push --platform linux/amd64,linux/arm64 --target vendor -t $(namespace)$(tag)-vendor -f ./Dockerfile .
version:
@echo $(tag)
@echo $(namespace)$(tag)
vendor-build:
docker build -t $(tag)-vendor --build-arg TAG=$(tag) -f ./build/Dockerfile-vendor .
vendor-tag:
docker tag $(tag)-vendor $(namespace)$(tag)-vendor
vendor-push:
docker push $(namespace)$(tag)-vendor
.PHONY: clean vendor swagger build build-multistage vendor-build vendor-tag vendor-push tag push run version
.PHONY: clean vendor swagger build build-release build-vendor run version

View File

@@ -1,16 +1,19 @@
# Goldpinger [![Build Status](https://travis-ci.com/bloomberg/goldpinger.svg?branch=master)](https://travis-ci.com/bloomberg/goldpinger)
# Goldpinger
__Goldpinger__ makes calls between its instances for visibility and alerting.
It runs as a `DaemonSet` on `Kubernetes` and produces `Prometheus` metrics that can be scraped, visualised and alerted on.
[![Publish](https://github.com/bloomberg/goldpinger/actions/workflows/publish.yml/badge.svg)](https://github.com/bloomberg/goldpinger/actions/workflows/publish.yml)
__Goldpinger__ makes calls between its instances to monitor your networking.
It runs as a [`DaemonSet`](#example-yaml) on `Kubernetes` and produces `Prometheus` metrics that can be [scraped](#prometheus), [visualised](#grafana) and [alerted](#alert-manager) on.
Oh, and it gives you the graph below for your cluster. Check out the [video explainer](https://youtu.be/DSFxRz_0TU4).
![](./extras/screenshot.png)
[:tada: 1M+ pulls from docker hub!](https://hub.docker.com/r/bloomberg/goldpinger/tags)
## On the menu
- [Goldpinger ![Build Status](https://travis-ci.com/bloomberg/goldpinger)](#goldpinger-build-statushttpstravis-cicombloomberggoldpinger)
- [Goldpinger](#goldpinger)
- [On the menu](#on-the-menu)
- [Rationale](#rationale)
- [Quick start](#quick-start)
@@ -27,6 +30,8 @@ Oh, and it gives you the graph below for your cluster. Check out the [video expl
- [Prometheus](#prometheus)
- [Grafana](#grafana)
- [Alert Manager](#alert-manager)
- [Chaos Engineering](#chaos-engineering)
- [Authors](#authors)
- [Contributions](#contributions)
- [License](#license)
@@ -34,11 +39,10 @@ Oh, and it gives you the graph below for your cluster. Check out the [video expl
We built __Goldpinger__ to troubleshoot, visualise and alert on our networking layer while adopting `Kubernetes` at Bloomberg. It has since become the go-to tool to see connectivity and slowness issues.
It's small, simple and you'll wonder why you hadn't had it before.
It's small (~16MB), simple and you'll wonder why you hadn't had it before.
If you'd like to know more, you can watch [our presentation at Kubecon 2018 Seattle](https://youtu.be/DSFxRz_0TU4).
## Quick start
Getting from sources:
@@ -52,12 +56,9 @@ Getting from [docker hub](https://hub.docker.com/r/bloomberg/goldpinger):
```sh
# get from docker hub
docker pull bloomberg/goldpinger
docker pull bloomberg/goldpinger:v3.0.0
```
Note, that in order to guarantee correct versions of dependencies, the project [uses `dep`](./Makefile).
## Building
The repo comes with two ways of building a `docker` image: compiling locally, and compiling using a multi-stage `Dockerfile` image. :warning: Depending on your `docker` setup, you might need to prepend the commands below with `sudo`.
@@ -67,41 +68,36 @@ The repo comes with two ways of building a `docker` image: compiling locally, an
You will need `docker` version 17.05+ installed to support multi-stage builds.
```sh
# step 1: launch the build
make build-multistage
# Build a local container without publishing
make build
# step 2: push the image somewhere
namespace="docker.io/myhandle/" make tag
namespace="docker.io/myhandle/" make push
# Build & push the image somewhere
namespace="docker.io/myhandle/" make build-release
```
This was contributed via [@michiel](https://github.com/michiel) - kudos !
### Compiling locally
In order to build `Goldpinger`, you are going to need `go` version 1.10+, `dep`, and `docker`.
In order to build `Goldpinger`, you are going to need `go` version 1.15+ and `docker`.
Building from source code consists of compiling the binary and building a [Docker image](./build/Dockerfile-simple):
Building from source code consists of compiling the binary and building a [Docker image](./Dockerfile):
```sh
# step 0: check out the code into your $GOPATH
go get github.com/bloomberg/goldpinger/cmd/goldpinger
cd $GOPATH/src/github.com/bloomberg/goldpinger
# step 0: check out the code
git clone https://github.com/bloomberg/goldpinger.git
cd goldpinger
# step 1: download the dependencies via dep ensure
make vendor
# step 2: compile the binary for the desired architecture
# step 1: compile the binary for the desired architecture
make bin/goldpinger
# at this stage you should be able to run the binary
./bin/goldpinger --help
# step 3: build the docker image containing the binary
make build
# step 2: build the docker image containing the binary
namespace="docker.io/myhandle/" make build
# step 4: push the image somewhere
namespace="docker.io/myhandle/" make tag
namespace="docker.io/myhandle/" make push
# step 3: push the image somewhere
docker push $(namespace="docker.io/myhandle/" make version)
```
## Installation
@@ -114,11 +110,15 @@ namespace="docker.io/myhandle/" make push
### Example YAML
Here's an example of what you can do (using the in-cluster authentication to `Kubernetes` apiserver).
```yaml
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: goldpinger-serviceaccount
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
@@ -140,7 +140,7 @@ spec:
labels:
app: goldpinger
spec:
serviceAccount: "goldpinger-serviceaccount"
serviceAccount: goldpinger-serviceaccount
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
@@ -165,7 +165,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
image: "docker.io/bloomberg/goldpinger:2.0.2"
image: "docker.io/bloomberg/goldpinger:v3.0.0"
imagePullPolicy: Always
securityContext:
allowPrivilegeEscalation: false
@@ -223,12 +223,18 @@ roleRef:
name: view
subjects:
- kind: ServiceAccount
name: default
name: goldpinger-serviceaccount
namespace: default
```
You can also see [an example of using `kubeconfig` in the `./extras`](./extras/example-with-kubeconfig.yaml).
### Using with IPv4/IPv6 dual-stack
If your pods having IPv4 and IPv6 addresses assigned and you want to test communication over IPv6, you can specify the `USE_IPV6` environment variable which will use the IPv6 address on the pod and host.
![ipv6](./extras/screenshot-ipv6.png)
### Note on DNS
Note, that on top of resolving the other pods, all instances can also try to resolve arbitrary DNS. This allows you to test your DNS setup.
@@ -296,7 +302,7 @@ To get you started, here's a rule that will trigger an alert if there are any no
```yaml
alert: goldpinger_nodes_unhealthy
expr: sum(goldpinger_nodes_health_total{status="unhealthy"})
BY (goldpinger_instance) > 0
BY (instance, goldpinger_instance) > 0
for: 5m
annotations:
description: |
@@ -306,6 +312,15 @@ annotations:
Similarly, why not :heart: contribute some amazing alerts for others to use ?
### Chaos Engineering
Goldpinger also makes for a pretty good monitoring tool in when practicing Chaos Engineering. Check out [PowerfulSeal](https://github.com/bloomberg/powerfulseal), if you'd like to do some Chaos Engineering for Kubernetes.
## Authors
Goldpinger was created by [Mikolaj Pawlikowski](https://github.com/seeker89) and ported to Go by Chris Green.
## Contributions
We :heart: contributions.

View File

@@ -1,6 +0,0 @@
FROM scratch
COPY bin/goldpinger /goldpinger
COPY static /static
ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"]

View File

@@ -1,3 +0,0 @@
ARG TAG
FROM $TAG
COPY vendor /goldpinger-vendor-sources

View File

@@ -24,18 +24,14 @@ if [ -z "${PKG}" ]; then
echo "PKG must be set"
exit 1
fi
if [ -z "${ARCH}" ]; then
echo "ARCH must be set"
exit 1
fi
if [ -z "${VERSION}" ]; then
echo "VERSION must be set"
exit 1
fi
export CGO_ENABLED=0
export GOARCH="${ARCH}"
export GOOS=${GOOS:-}
export GOARCH="${ARCH:-amd64}"
export GOOS=${GOOS:-linux}
go build \
-ldflags "-X 'main.Version=${VERSION}' -X 'main.Build=`date`'" \

View File

@@ -15,17 +15,19 @@
package main
import (
"log"
"os"
"strconv"
"github.com/go-openapi/loads"
"go.uber.org/zap"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/utils/net"
"github.com/bloomberg/goldpinger/pkg/goldpinger"
"github.com/bloomberg/goldpinger/pkg/restapi"
"github.com/bloomberg/goldpinger/pkg/restapi/operations"
"github.com/bloomberg/goldpinger/v3/pkg/goldpinger"
"github.com/bloomberg/goldpinger/v3/pkg/restapi"
"github.com/bloomberg/goldpinger/v3/pkg/restapi/operations"
flags "github.com/jessevdk/go-flags"
)
@@ -34,14 +36,37 @@ var (
Version, Build string
)
func main() {
func getLogger() *zap.Logger {
var logger *zap.Logger
var err error
log.Println("Goldpinger version:", Version, "build:", Build)
// We haven't parsed flags at this stage and that might be error prone
// so just use an envvar
if debug, err := strconv.ParseBool(os.Getenv("DEBUG")); err == nil && debug {
logger, err = zap.NewDevelopment()
} else {
logger, err = zap.NewProduction()
}
if err != nil {
panic(err)
}
zap.ReplaceGlobals(logger)
return logger
}
func main() {
logger := getLogger()
defer logger.Sync()
undo := zap.RedirectStdLog(logger)
defer undo()
logger.Info("Goldpinger", zap.String("version", Version), zap.String("build", Build))
// load embedded swagger file
swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
if err != nil {
log.Fatalln(err)
logger.Error("Coud not parse swagger", zap.Error(err))
}
// create new service API
@@ -58,7 +83,7 @@ func main() {
for _, optsGroup := range api.CommandLineOptionsGroups {
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
if err != nil {
log.Fatalln(err)
logger.Error("Coud not add flag group", zap.Error(err))
}
}
@@ -72,22 +97,28 @@ func main() {
os.Exit(code)
}
if goldpinger.GoldpingerConfig.Namespace == nil {
goldpinger.GoldpingerConfig.Namespace = &goldpinger.PodNamespace
} else {
logger.Info("Using configured namespace", zap.String("namespace", *goldpinger.GoldpingerConfig.Namespace))
}
// make a kubernetes client
var config *rest.Config
if goldpinger.GoldpingerConfig.KubeConfigPath == "" {
log.Println("Kubeconfig not specified, trying to use in cluster config")
logger.Info("Kubeconfig not specified, trying to use in cluster config")
config, err = rest.InClusterConfig()
} else {
log.Println("Kubeconfig specified in ", goldpinger.GoldpingerConfig.KubeConfigPath)
logger.Info("Kubeconfig specified", zap.String("path", goldpinger.GoldpingerConfig.KubeConfigPath))
config, err = clientcmd.BuildConfigFromFlags("", goldpinger.GoldpingerConfig.KubeConfigPath)
}
if err != nil {
log.Fatalln("Error getting config ", err.Error())
logger.Fatal("Error getting config ", zap.Error(err))
}
// create the clientset
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
log.Fatalln("kubernetes.NewForConfig error ", err.Error())
logger.Fatal("kubernetes.NewForConfig error ", zap.Error(err))
}
goldpinger.GoldpingerConfig.KubernetesClient = clientset
@@ -97,20 +128,29 @@ func main() {
}
if goldpinger.GoldpingerConfig.PodIP == "" {
log.Println("PodIP not set: pinging all pods")
logger.Info("PodIP not set: pinging all pods")
}
if goldpinger.GoldpingerConfig.PingNumber == 0 {
log.Println("--ping-number set to 0: pinging all pods")
logger.Info("--ping-number set to 0: pinging all pods")
}
if goldpinger.GoldpingerConfig.IPVersions == nil || len(goldpinger.GoldpingerConfig.IPVersions) == 0 {
logger.Info("IPVersions not set: settings to 4 (IPv4)")
goldpinger.GoldpingerConfig.IPVersions = []string{"4"}
}
if len(goldpinger.GoldpingerConfig.IPVersions) > 1 {
logger.Warn("Multiple IP versions not supported. Will use first version specified as default", zap.Strings("IPVersions", goldpinger.GoldpingerConfig.IPVersions))
}
if goldpinger.GoldpingerConfig.IPVersions[0] != string(net.IPv4) && goldpinger.GoldpingerConfig.IPVersions[0] != net.IPv6 {
logger.Error("Unknown IP version specified: expected values are 4 or 6", zap.Strings("IPVersions", goldpinger.GoldpingerConfig.IPVersions))
}
goldpinger.GoldpingerConfig.PodSelecter = goldpinger.NewPodSelecter(goldpinger.GoldpingerConfig.PingNumber, goldpinger.GoldpingerConfig.PodIP, goldpinger.GetAllPods)
server.ConfigureAPI()
goldpinger.StartUpdater()
log.Println("All good, starting serving the API")
logger.Info("All good, starting serving the API")
// serve API
if err := server.Serve(); err != nil {
log.Fatalln(err)
logger.Fatal("Error serving the API", zap.Error(err))
}
}

View File

@@ -1,8 +0,0 @@
#!/bin/sh
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD" \
&& make tag \
&& make push \
&& make vendor-tag \
&& make vendor-push

View File

@@ -46,7 +46,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
image: "docker.io/bloomberg/goldpinger:2.0.0"
image: "docker.io/bloomberg/goldpinger:v3.0.0"
imagePullPolicy: Always
securityContext:
allowPrivilegeEscalation: false

View File

@@ -5,19 +5,16 @@ metadata:
name: goldpinger
labels:
app: goldpinger
version: "2.0.0"
spec:
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: goldpinger
version: "2.0.0"
template:
metadata:
labels:
app: goldpinger
version: "2.0.0"
spec:
securityContext:
runAsNonRoot: true
@@ -52,7 +49,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
image: "docker.io/bloomberg/goldpinger:2.0.0"
image: "docker.io/bloomberg/goldpinger:v3.0.0"
imagePullPolicy: Always
securityContext:
allowPrivilegeEscalation: false

BIN
extras/screenshot-ipv6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

34
go.mod Normal file
View File

@@ -0,0 +1,34 @@
module github.com/bloomberg/goldpinger/v3
go 1.15
require (
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/cespare/xxhash v1.1.0
github.com/go-openapi/errors v0.20.0
github.com/go-openapi/loads v0.19.5
github.com/go-openapi/runtime v0.19.26
github.com/go-openapi/spec v0.19.8
github.com/go-openapi/strfmt v0.20.0
github.com/go-openapi/swag v0.19.9
github.com/go-openapi/validate v0.19.10
github.com/jessevdk/go-flags v1.4.0
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/prometheus/client_golang v0.9.1
github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39 // indirect
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d // indirect
github.com/stuartnelson3/go-rendezvous v0.2.0
go.uber.org/zap v1.14.1
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
honnef.co/go/tools v0.0.1-2020.1.3 // indirect
k8s.io/api v0.19.14
k8s.io/apimachinery v0.19.14
k8s.io/client-go v0.19.14
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
)

592
go.sum Normal file
View File

@@ -0,0 +1,592 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg=
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=
github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=
github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE=
github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ=
github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/errors v0.20.0 h1:Sxpo9PjEHDzhs3FbnGNonvDgWcMW2U7wGTcDDSFSceM=
github.com/go-openapi/errors v0.20.0/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs=
github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI=
github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls=
github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY=
github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64=
github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4=
github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo=
github.com/go-openapi/runtime v0.19.26 h1:K/6PoVNj5WJXUnMk+VEbELeXjtBkCS1UxTDa04tdXE0=
github.com/go-openapi/runtime v0.19.26/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg=
github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY=
github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM=
github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE=
github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo=
github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk=
github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0=
github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY=
github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg=
github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs=
github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI=
github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI=
github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk=
github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28=
github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo=
github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk=
github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw=
github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360=
github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg=
github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE=
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8=
github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc=
github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc=
github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8=
github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1 h1:K47Rk0v/fkEfwfQet2KWhscE0cJzjgCCDBG2KHZoVno=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39 h1:Cto4X6SVMWRPBkJ/3YHn1iDGDGc/Z+sW+AEMKHMVvN4=
github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d h1:GoAlyOgbOEIFdaDqxJVlbOQ1DtGmZWs/Qau0hIlk+WQ=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stuartnelson3/go-rendezvous v0.2.0 h1:H5IexrsptBzCMQEjTRrNH20MVXGqpFf1JUCPglaxd6I=
github.com/stuartnelson3/go-rendezvous v0.2.0/go.mod h1:njfgP6zISyRnZ3iQN13NSEILfSNLN4ysxBoGxHs5PJ0=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE=
go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE=
go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8=
go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo=
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.19.14 h1:P1TzVeuLsnKbp+LTtIa5IyEtSnU0yj4LqiKKRp1NU9Y=
k8s.io/api v0.19.14/go.mod h1:5IAteKHunZAtX2SeMM705TybJtUDVhUKJj2atAuT4rQ=
k8s.io/apimachinery v0.19.14 h1:AxDxCm6P0xR45VfPjO2BVDGfjRWZ4GMdcib8aoG2rxI=
k8s.io/apimachinery v0.19.14/go.mod h1:RMyblyny2ZcDQ/oVE+lC31u7XTHUaSXEK2IhgtwGxfc=
k8s.io/client-go v0.19.14 h1:D3V4mC6lQN3ZaABhOznxZXSsxMR5cdChjeMP4/pY4H8=
k8s.io/client-go v0.19.14/go.mod h1:iWwXK/etTTPyssCycvgdQ9d6i0k93HXLtksUQ6A67WE=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno=
sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=

View File

@@ -6,12 +6,10 @@ package client
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/bloomberg/goldpinger/v3/pkg/client/operations"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/bloomberg/goldpinger/pkg/client/operations"
"github.com/go-openapi/strfmt"
)
// Default goldpinger HTTP client.
@@ -56,9 +54,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Goldpinger
cli := new(Goldpinger)
cli.Transport = transport
cli.Operations = operations.New(transport, formats)
return cli
}
@@ -103,7 +99,7 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
// Goldpinger is a client for goldpinger
type Goldpinger struct {
Operations *operations.Client
Operations operations.ClientService
Transport runtime.ClientTransport
}
@@ -111,7 +107,5 @@ type Goldpinger struct {
// SetTransport changes the transport on the client and all its subresources
func (c *Goldpinger) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
c.Operations.SetTransport(transport)
}

View File

@@ -13,51 +13,49 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/strfmt"
)
// NewCheckAllPodsParams creates a new CheckAllPodsParams object
// with the default values initialized.
// NewCheckAllPodsParams creates a new CheckAllPodsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewCheckAllPodsParams() *CheckAllPodsParams {
return &CheckAllPodsParams{
timeout: cr.DefaultTimeout,
}
}
// NewCheckAllPodsParamsWithTimeout creates a new CheckAllPodsParams object
// with the default values initialized, and the ability to set a timeout on a request
// with the ability to set a timeout on a request.
func NewCheckAllPodsParamsWithTimeout(timeout time.Duration) *CheckAllPodsParams {
return &CheckAllPodsParams{
timeout: timeout,
}
}
// NewCheckAllPodsParamsWithContext creates a new CheckAllPodsParams object
// with the default values initialized, and the ability to set a context for a request
// with the ability to set a context for a request.
func NewCheckAllPodsParamsWithContext(ctx context.Context) *CheckAllPodsParams {
return &CheckAllPodsParams{
Context: ctx,
}
}
// NewCheckAllPodsParamsWithHTTPClient creates a new CheckAllPodsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
// with the ability to set a custom HTTPClient for a request.
func NewCheckAllPodsParamsWithHTTPClient(client *http.Client) *CheckAllPodsParams {
return &CheckAllPodsParams{
HTTPClient: client,
}
}
/*CheckAllPodsParams contains all the parameters to send to the API endpoint
for the check all pods operation typically these are written to a http.Request
/* CheckAllPodsParams contains all the parameters to send to the API endpoint
for the check all pods operation.
Typically these are written to a http.Request.
*/
type CheckAllPodsParams struct {
timeout time.Duration
@@ -65,6 +63,21 @@ type CheckAllPodsParams struct {
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the check all pods params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CheckAllPodsParams) WithDefaults() *CheckAllPodsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the check all pods params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CheckAllPodsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the check all pods params
func (o *CheckAllPodsParams) WithTimeout(timeout time.Duration) *CheckAllPodsParams {
o.SetTimeout(timeout)

View File

@@ -10,10 +10,9 @@ import (
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
strfmt "github.com/go-openapi/strfmt"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// CheckAllPodsReader is a Reader for the CheckAllPods structure.
@@ -24,16 +23,14 @@ type CheckAllPodsReader struct {
// ReadResponse reads a server response into the received o.
func (o *CheckAllPodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewCheckAllPodsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
@@ -42,7 +39,7 @@ func NewCheckAllPodsOK() *CheckAllPodsOK {
return &CheckAllPodsOK{}
}
/*CheckAllPodsOK handles this case with default header values.
/* CheckAllPodsOK describes a response with status code 200, with default header values.
Success, return response
*/
@@ -53,6 +50,9 @@ type CheckAllPodsOK struct {
func (o *CheckAllPodsOK) Error() string {
return fmt.Sprintf("[GET /check_all][%d] checkAllPodsOK %+v", 200, o.Payload)
}
func (o *CheckAllPodsOK) GetPayload() *models.CheckAllResults {
return o.Payload
}
func (o *CheckAllPodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

View File

@@ -13,51 +13,49 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/strfmt"
)
// NewCheckServicePodsParams creates a new CheckServicePodsParams object
// with the default values initialized.
// NewCheckServicePodsParams creates a new CheckServicePodsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewCheckServicePodsParams() *CheckServicePodsParams {
return &CheckServicePodsParams{
timeout: cr.DefaultTimeout,
}
}
// NewCheckServicePodsParamsWithTimeout creates a new CheckServicePodsParams object
// with the default values initialized, and the ability to set a timeout on a request
// with the ability to set a timeout on a request.
func NewCheckServicePodsParamsWithTimeout(timeout time.Duration) *CheckServicePodsParams {
return &CheckServicePodsParams{
timeout: timeout,
}
}
// NewCheckServicePodsParamsWithContext creates a new CheckServicePodsParams object
// with the default values initialized, and the ability to set a context for a request
// with the ability to set a context for a request.
func NewCheckServicePodsParamsWithContext(ctx context.Context) *CheckServicePodsParams {
return &CheckServicePodsParams{
Context: ctx,
}
}
// NewCheckServicePodsParamsWithHTTPClient creates a new CheckServicePodsParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
// with the ability to set a custom HTTPClient for a request.
func NewCheckServicePodsParamsWithHTTPClient(client *http.Client) *CheckServicePodsParams {
return &CheckServicePodsParams{
HTTPClient: client,
}
}
/*CheckServicePodsParams contains all the parameters to send to the API endpoint
for the check service pods operation typically these are written to a http.Request
/* CheckServicePodsParams contains all the parameters to send to the API endpoint
for the check service pods operation.
Typically these are written to a http.Request.
*/
type CheckServicePodsParams struct {
timeout time.Duration
@@ -65,6 +63,21 @@ type CheckServicePodsParams struct {
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the check service pods params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CheckServicePodsParams) WithDefaults() *CheckServicePodsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the check service pods params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CheckServicePodsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the check service pods params
func (o *CheckServicePodsParams) WithTimeout(timeout time.Duration) *CheckServicePodsParams {
o.SetTimeout(timeout)

View File

@@ -10,10 +10,9 @@ import (
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
strfmt "github.com/go-openapi/strfmt"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// CheckServicePodsReader is a Reader for the CheckServicePods structure.
@@ -24,16 +23,14 @@ type CheckServicePodsReader struct {
// ReadResponse reads a server response into the received o.
func (o *CheckServicePodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewCheckServicePodsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
@@ -42,7 +39,7 @@ func NewCheckServicePodsOK() *CheckServicePodsOK {
return &CheckServicePodsOK{}
}
/*CheckServicePodsOK handles this case with default header values.
/* CheckServicePodsOK describes a response with status code 200, with default header values.
Success, return response
*/
@@ -53,6 +50,9 @@ type CheckServicePodsOK struct {
func (o *CheckServicePodsOK) Error() string {
return fmt.Sprintf("[GET /check][%d] checkServicePodsOK %+v", 200, o.Payload)
}
func (o *CheckServicePodsOK) GetPayload() *models.CheckResults {
return o.Payload
}
func (o *CheckServicePodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

View File

@@ -0,0 +1,126 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewClusterHealthParams creates a new ClusterHealthParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewClusterHealthParams() *ClusterHealthParams {
return &ClusterHealthParams{
timeout: cr.DefaultTimeout,
}
}
// NewClusterHealthParamsWithTimeout creates a new ClusterHealthParams object
// with the ability to set a timeout on a request.
func NewClusterHealthParamsWithTimeout(timeout time.Duration) *ClusterHealthParams {
return &ClusterHealthParams{
timeout: timeout,
}
}
// NewClusterHealthParamsWithContext creates a new ClusterHealthParams object
// with the ability to set a context for a request.
func NewClusterHealthParamsWithContext(ctx context.Context) *ClusterHealthParams {
return &ClusterHealthParams{
Context: ctx,
}
}
// NewClusterHealthParamsWithHTTPClient creates a new ClusterHealthParams object
// with the ability to set a custom HTTPClient for a request.
func NewClusterHealthParamsWithHTTPClient(client *http.Client) *ClusterHealthParams {
return &ClusterHealthParams{
HTTPClient: client,
}
}
/* ClusterHealthParams contains all the parameters to send to the API endpoint
for the cluster health operation.
Typically these are written to a http.Request.
*/
type ClusterHealthParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the cluster health params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ClusterHealthParams) WithDefaults() *ClusterHealthParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the cluster health params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ClusterHealthParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the cluster health params
func (o *ClusterHealthParams) WithTimeout(timeout time.Duration) *ClusterHealthParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the cluster health params
func (o *ClusterHealthParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the cluster health params
func (o *ClusterHealthParams) WithContext(ctx context.Context) *ClusterHealthParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the cluster health params
func (o *ClusterHealthParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the cluster health params
func (o *ClusterHealthParams) WithHTTPClient(client *http.Client) *ClusterHealthParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the cluster health params
func (o *ClusterHealthParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *ClusterHealthParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,105 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// ClusterHealthReader is a Reader for the ClusterHealth structure.
type ClusterHealthReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ClusterHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewClusterHealthOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 418:
result := NewClusterHealthIMATeapot()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewClusterHealthOK creates a ClusterHealthOK with default headers values
func NewClusterHealthOK() *ClusterHealthOK {
return &ClusterHealthOK{}
}
/* ClusterHealthOK describes a response with status code 200, with default header values.
Healthy cluster
*/
type ClusterHealthOK struct {
Payload *models.ClusterHealthResults
}
func (o *ClusterHealthOK) Error() string {
return fmt.Sprintf("[GET /cluster_health][%d] clusterHealthOK %+v", 200, o.Payload)
}
func (o *ClusterHealthOK) GetPayload() *models.ClusterHealthResults {
return o.Payload
}
func (o *ClusterHealthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.ClusterHealthResults)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewClusterHealthIMATeapot creates a ClusterHealthIMATeapot with default headers values
func NewClusterHealthIMATeapot() *ClusterHealthIMATeapot {
return &ClusterHealthIMATeapot{}
}
/* ClusterHealthIMATeapot describes a response with status code 418, with default header values.
Unhealthy cluster
*/
type ClusterHealthIMATeapot struct {
Payload *models.ClusterHealthResults
}
func (o *ClusterHealthIMATeapot) Error() string {
return fmt.Sprintf("[GET /cluster_health][%d] clusterHealthIMATeapot %+v", 418, o.Payload)
}
func (o *ClusterHealthIMATeapot) GetPayload() *models.ClusterHealthResults {
return o.Payload
}
func (o *ClusterHealthIMATeapot) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.ClusterHealthResults)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}

View File

@@ -13,51 +13,49 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/strfmt"
)
// NewHealthzParams creates a new HealthzParams object
// with the default values initialized.
// NewHealthzParams creates a new HealthzParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewHealthzParams() *HealthzParams {
return &HealthzParams{
timeout: cr.DefaultTimeout,
}
}
// NewHealthzParamsWithTimeout creates a new HealthzParams object
// with the default values initialized, and the ability to set a timeout on a request
// with the ability to set a timeout on a request.
func NewHealthzParamsWithTimeout(timeout time.Duration) *HealthzParams {
return &HealthzParams{
timeout: timeout,
}
}
// NewHealthzParamsWithContext creates a new HealthzParams object
// with the default values initialized, and the ability to set a context for a request
// with the ability to set a context for a request.
func NewHealthzParamsWithContext(ctx context.Context) *HealthzParams {
return &HealthzParams{
Context: ctx,
}
}
// NewHealthzParamsWithHTTPClient creates a new HealthzParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
// with the ability to set a custom HTTPClient for a request.
func NewHealthzParamsWithHTTPClient(client *http.Client) *HealthzParams {
return &HealthzParams{
HTTPClient: client,
}
}
/*HealthzParams contains all the parameters to send to the API endpoint
for the healthz operation typically these are written to a http.Request
/* HealthzParams contains all the parameters to send to the API endpoint
for the healthz operation.
Typically these are written to a http.Request.
*/
type HealthzParams struct {
timeout time.Duration
@@ -65,6 +63,21 @@ type HealthzParams struct {
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the healthz params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *HealthzParams) WithDefaults() *HealthzParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the healthz params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *HealthzParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the healthz params
func (o *HealthzParams) WithTimeout(timeout time.Duration) *HealthzParams {
o.SetTimeout(timeout)

View File

@@ -10,10 +10,9 @@ import (
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
strfmt "github.com/go-openapi/strfmt"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// HealthzReader is a Reader for the Healthz structure.
@@ -24,23 +23,20 @@ type HealthzReader struct {
// ReadResponse reads a server response into the received o.
func (o *HealthzReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewHealthzOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 503:
result := NewHealthzServiceUnavailable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
@@ -49,7 +45,7 @@ func NewHealthzOK() *HealthzOK {
return &HealthzOK{}
}
/*HealthzOK handles this case with default header values.
/* HealthzOK describes a response with status code 200, with default header values.
Health check report
*/
@@ -60,6 +56,9 @@ type HealthzOK struct {
func (o *HealthzOK) Error() string {
return fmt.Sprintf("[GET /healthz][%d] healthzOK %+v", 200, o.Payload)
}
func (o *HealthzOK) GetPayload() *models.HealthCheckResults {
return o.Payload
}
func (o *HealthzOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
@@ -78,7 +77,7 @@ func NewHealthzServiceUnavailable() *HealthzServiceUnavailable {
return &HealthzServiceUnavailable{}
}
/*HealthzServiceUnavailable handles this case with default header values.
/* HealthzServiceUnavailable describes a response with status code 503, with default header values.
Unhealthy service
*/
@@ -89,6 +88,9 @@ type HealthzServiceUnavailable struct {
func (o *HealthzServiceUnavailable) Error() string {
return fmt.Sprintf("[GET /healthz][%d] healthzServiceUnavailable %+v", 503, o.Payload)
}
func (o *HealthzServiceUnavailable) GetPayload() *models.HealthCheckResults {
return o.Payload
}
func (o *HealthzServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

View File

@@ -6,13 +6,14 @@ package operations
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
"fmt"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new operations API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
@@ -24,116 +25,212 @@ type Client struct {
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
CheckAllPods(params *CheckAllPodsParams, opts ...ClientOption) (*CheckAllPodsOK, error)
CheckServicePods(params *CheckServicePodsParams, opts ...ClientOption) (*CheckServicePodsOK, error)
ClusterHealth(params *ClusterHealthParams, opts ...ClientOption) (*ClusterHealthOK, error)
Healthz(params *HealthzParams, opts ...ClientOption) (*HealthzOK, error)
Ping(params *PingParams, opts ...ClientOption) (*PingOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
CheckAllPods Queries the API server for all other pods in this service, and makes all of them query all of their neighbours, using their pods IPs. Calls their /check endpoint.
CheckAllPods Queries the API server for all other pods in this service, and makes all of them query all of their neighbours, using their pods IPs. Calls their /check endpoint.
*/
func (a *Client) CheckAllPods(params *CheckAllPodsParams) (*CheckAllPodsOK, error) {
func (a *Client) CheckAllPods(params *CheckAllPodsParams, opts ...ClientOption) (*CheckAllPodsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCheckAllPodsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
op := &runtime.ClientOperation{
ID: "checkAllPods",
Method: "GET",
PathPattern: "/check_all",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &CheckAllPodsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
return result.(*CheckAllPodsOK), nil
success, ok := result.(*CheckAllPodsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for checkAllPods: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CheckServicePods Queries the API server for all other pods in this service, and pings them via their pods IPs. Calls their /ping endpoint
CheckServicePods Queries the API server for all other pods in this service, and pings them via their pods IPs. Calls their /ping endpoint
*/
func (a *Client) CheckServicePods(params *CheckServicePodsParams) (*CheckServicePodsOK, error) {
func (a *Client) CheckServicePods(params *CheckServicePodsParams, opts ...ClientOption) (*CheckServicePodsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCheckServicePodsParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
op := &runtime.ClientOperation{
ID: "checkServicePods",
Method: "GET",
PathPattern: "/check",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &CheckServicePodsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
return result.(*CheckServicePodsOK), nil
success, ok := result.(*CheckServicePodsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for checkServicePods: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
Healthz The healthcheck endpoint provides detailed information about the health of a web service. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.
ClusterHealth Checks the full graph. Returns a binary OK or not OK.
*/
func (a *Client) Healthz(params *HealthzParams) (*HealthzOK, error) {
func (a *Client) ClusterHealth(params *ClusterHealthParams, opts ...ClientOption) (*ClusterHealthOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewClusterHealthParams()
}
op := &runtime.ClientOperation{
ID: "clusterHealth",
Method: "GET",
PathPattern: "/cluster_health",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &ClusterHealthReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ClusterHealthOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for clusterHealth: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
Healthz The healthcheck endpoint provides detailed information about the health of a web service. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.
*/
func (a *Client) Healthz(params *HealthzParams, opts ...ClientOption) (*HealthzOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewHealthzParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
op := &runtime.ClientOperation{
ID: "healthz",
Method: "GET",
PathPattern: "/healthz",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &HealthzReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
return result.(*HealthzOK), nil
success, ok := result.(*HealthzOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for healthz: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
Ping return query stats
Ping return query stats
*/
func (a *Client) Ping(params *PingParams) (*PingOK, error) {
func (a *Client) Ping(params *PingParams, opts ...ClientOption) (*PingOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPingParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
op := &runtime.ClientOperation{
ID: "ping",
Method: "GET",
PathPattern: "/ping",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{""},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PingReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
})
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
return result.(*PingOK), nil
success, ok := result.(*PingOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for ping: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client

View File

@@ -13,51 +13,49 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/strfmt"
)
// NewPingParams creates a new PingParams object
// with the default values initialized.
// NewPingParams creates a new PingParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPingParams() *PingParams {
return &PingParams{
timeout: cr.DefaultTimeout,
}
}
// NewPingParamsWithTimeout creates a new PingParams object
// with the default values initialized, and the ability to set a timeout on a request
// with the ability to set a timeout on a request.
func NewPingParamsWithTimeout(timeout time.Duration) *PingParams {
return &PingParams{
timeout: timeout,
}
}
// NewPingParamsWithContext creates a new PingParams object
// with the default values initialized, and the ability to set a context for a request
// with the ability to set a context for a request.
func NewPingParamsWithContext(ctx context.Context) *PingParams {
return &PingParams{
Context: ctx,
}
}
// NewPingParamsWithHTTPClient creates a new PingParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
// with the ability to set a custom HTTPClient for a request.
func NewPingParamsWithHTTPClient(client *http.Client) *PingParams {
return &PingParams{
HTTPClient: client,
}
}
/*PingParams contains all the parameters to send to the API endpoint
for the ping operation typically these are written to a http.Request
/* PingParams contains all the parameters to send to the API endpoint
for the ping operation.
Typically these are written to a http.Request.
*/
type PingParams struct {
timeout time.Duration
@@ -65,6 +63,21 @@ type PingParams struct {
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the ping params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PingParams) WithDefaults() *PingParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the ping params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PingParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the ping params
func (o *PingParams) WithTimeout(timeout time.Duration) *PingParams {
o.SetTimeout(timeout)

View File

@@ -10,10 +10,9 @@ import (
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
strfmt "github.com/go-openapi/strfmt"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// PingReader is a Reader for the Ping structure.
@@ -24,16 +23,14 @@ type PingReader struct {
// ReadResponse reads a server response into the received o.
func (o *PingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPingOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
@@ -42,7 +39,7 @@ func NewPingOK() *PingOK {
return &PingOK{}
}
/*PingOK handles this case with default header values.
/* PingOK describes a response with status code 200, with default header values.
return success
*/
@@ -53,6 +50,9 @@ type PingOK struct {
func (o *PingOK) Error() string {
return fmt.Sprintf("[GET /ping][%d] pingOK %+v", 200, o.Payload)
}
func (o *PingOK) GetPayload() *models.PingResults {
return o.Payload
}
func (o *PingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

View File

@@ -15,34 +15,109 @@
package goldpinger
import (
"context"
"errors"
"fmt"
"net"
"sort"
"strconv"
"sync"
"time"
apiclient "github.com/bloomberg/goldpinger/pkg/client"
"github.com/bloomberg/goldpinger/pkg/models"
apiclient "github.com/bloomberg/goldpinger/v3/pkg/client"
"github.com/bloomberg/goldpinger/v3/pkg/client/operations"
"github.com/bloomberg/goldpinger/v3/pkg/models"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"go.uber.org/zap"
)
// CheckNeighbours queries the kubernetes API server for all other goldpinger pods
// then calls Ping() on each one
func CheckNeighbours(ps *PodSelecter) *models.CheckResults {
return PingAllPods(ps.SelectPods())
func CheckNeighbours(ctx context.Context) *models.CheckResults {
// Mux to prevent concurrent map address
checkResultsMux.Lock()
defer checkResultsMux.Unlock()
final := models.CheckResults{}
final.PodResults = make(map[string]models.PodResult)
for podName, podResult := range checkResults.PodResults {
final.PodResults[podName] = podResult
}
if len(GoldpingerConfig.DnsHosts) > 0 {
final.DNSResults = *checkDNS()
}
return &final
}
// CheckNeighboursNeighbours queries the kubernetes API server for all other goldpinger
// pods then calls Check() on each one
func CheckNeighboursNeighbours(ps *PodSelecter) *models.CheckAllResults {
return CheckAllPods(ps.SelectPods())
func CheckNeighboursNeighbours(ctx context.Context) *models.CheckAllResults {
return CheckAllPods(ctx, SelectPods())
}
// CheckCluster does a CheckNeighboursNeighbours and analyses results to produce a binary OK or not OK
func CheckCluster(ctx context.Context) *models.ClusterHealthResults {
start := time.Now()
output := models.ClusterHealthResults{
GeneratedAt: strfmt.DateTime(start),
OK: true,
}
selectedPods := SelectPods()
// precompute the expected set of nodes
expectedNodes := []string{}
for _, peer := range selectedPods {
expectedNodes = append(expectedNodes, peer.HostIP)
}
sort.Strings(expectedNodes)
// get the response we serve for check_all
checkAll := CheckAllPods(ctx, selectedPods)
// we should at the very least have a response from ourselves
if len(checkAll.Responses) < 1 {
output.OK = false
}
for _, resp := range checkAll.Responses {
// 1. check that all nodes report OK
if *resp.OK {
output.NodesHealthy = append(output.NodesHealthy, resp.HostIP.String())
} else {
output.NodesUnhealthy = append(output.NodesUnhealthy, resp.HostIP.String())
output.OK = false
}
output.NodesTotal++
// 2. check that all nodes report the expected peers
// on error, there might be no response from the node
if resp.Response == nil {
output.OK = false
continue
}
// if we get a response, let's check we get the expected nodes
observedNodes := []string{}
for _, peer := range resp.Response.PodResults {
observedNodes = append(observedNodes, string(peer.HostIP))
}
sort.Strings(observedNodes)
if len(observedNodes) != len(expectedNodes) {
output.OK = false
}
for i, val := range observedNodes {
if val != expectedNodes[i] {
output.OK = false
break
}
}
}
output.DurationNs = time.Since(start).Nanoseconds()
return &output
}
// PingAllPodsResult holds results from pinging all nodes
type PingAllPodsResult struct {
podName string
podResult models.PodResult
hostIPv4 strfmt.IPv4
podIP string
deleted bool
}
func pickPodHostIP(podIP, hostIP string) string {
@@ -70,126 +145,77 @@ func checkDNS() *models.DNSResults {
return &results
}
func PingAllPods(pods map[string]string) *models.CheckResults {
result := models.CheckResults{}
ch := make(chan PingAllPodsResult, len(pods))
wg := sync.WaitGroup{}
wg.Add(len(pods))
for podIP, hostIP := range pods {
go func(podIP string, hostIP string) {
// metrics
CountCall("made", "ping")
timer := GetLabeledPeersCallsTimer("ping", hostIP, podIP)
start := time.Now()
// setup
var channelResult PingAllPodsResult
channelResult.hostIPv4.UnmarshalText([]byte(hostIP))
channelResult.podIP = podIP
OK := false
var responseTime int64
client, err := getClient(pickPodHostIP(podIP, hostIP))
if err != nil {
channelResult.podResult = models.PodResult{HostIP: channelResult.hostIPv4, OK: &OK, Error: err.Error(), StatusCode: 500, ResponseTimeMs: responseTime}
channelResult.podIP = hostIP
CountError("ping")
} else {
resp, err := client.Operations.Ping(nil)
responseTime = time.Since(start).Nanoseconds() / int64(time.Millisecond)
OK = (err == nil)
if OK {
channelResult.podResult = models.PodResult{HostIP: channelResult.hostIPv4, OK: &OK, Response: resp.Payload, StatusCode: 200, ResponseTimeMs: responseTime}
timer.ObserveDuration()
} else {
channelResult.podResult = models.PodResult{HostIP: channelResult.hostIPv4, OK: &OK, Error: err.Error(), StatusCode: 504, ResponseTimeMs: responseTime}
CountError("ping")
}
}
ch <- channelResult
wg.Done()
}(podIP, hostIP)
}
if len(GoldpingerConfig.DnsHosts) > 0 {
result.DNSResults = *checkDNS()
}
wg.Wait()
close(ch)
counterHealthy, counterUnhealthy := 0.0, 0.0
result.PodResults = make(map[string]models.PodResult)
for response := range ch {
var podIPv4 strfmt.IPv4
podIPv4.UnmarshalText([]byte(response.podIP))
if *response.podResult.OK {
counterHealthy++
} else {
counterUnhealthy++
}
result.PodResults[response.podIP] = response.podResult
}
CountHealthyUnhealthyNodes(counterHealthy, counterUnhealthy)
return &result
}
// CheckServicePodsResult results of the /check operation
type CheckServicePodsResult struct {
podName string
checkAllPodResult models.CheckAllPodResult
hostIPv4 strfmt.IPv4
podIP string
podIPv4 strfmt.IPv4
}
func CheckAllPods(pods map[string]string) *models.CheckAllResults {
// CheckAllPods calls all neighbours and returns a detailed report
func CheckAllPods(checkAllCtx context.Context, pods map[string]*GoldpingerPod) *models.CheckAllResults {
result := models.CheckAllResults{Responses: make(map[string]models.CheckAllPodResult)}
ch := make(chan CheckServicePodsResult, len(pods))
wg := sync.WaitGroup{}
wg.Add(len(pods))
for podIP, hostIP := range pods {
go func(podIP string, hostIP string) {
for _, pod := range pods {
go func(pod *GoldpingerPod) {
// logger
logger := zap.L().With(
zap.String("op", "check"),
zap.String("name", pod.Name),
zap.String("hostIP", pod.HostIP),
zap.String("podIP", pod.PodIP),
)
// stats
CountCall("made", "check")
timer := GetLabeledPeersCallsTimer("check", hostIP, podIP)
timer := GetLabeledPeersCallsTimer("check", pod.HostIP, pod.PodIP)
// setup
var channelResult CheckServicePodsResult
channelResult.hostIPv4.UnmarshalText([]byte(hostIP))
channelResult.podIP = podIP
client, err := getClient(pickPodHostIP(podIP, hostIP))
channelResult.podName = pod.Name
channelResult.hostIPv4.UnmarshalText([]byte(pod.HostIP))
channelResult.podIPv4.UnmarshalText([]byte(pod.PodIP))
client, err := getClient(pickPodHostIP(pod.PodIP, pod.HostIP))
OK := false
if err != nil {
logger.Warn("Couldn't get a client for Check", zap.Error(err))
channelResult.checkAllPodResult = models.CheckAllPodResult{
OK: &OK,
PodIP: channelResult.podIPv4,
HostIP: channelResult.hostIPv4,
Error: err.Error(),
}
channelResult.podIP = hostIP
CountError("checkAll")
} else {
resp, err := client.Operations.CheckServicePods(nil)
checkCtx, cancel := context.WithTimeout(
checkAllCtx,
time.Duration(GoldpingerConfig.CheckTimeoutMs)*time.Millisecond,
)
defer cancel()
params := operations.NewCheckServicePodsParamsWithContext(checkCtx)
resp, err := client.Operations.CheckServicePods(params)
OK = (err == nil)
if OK {
logger.Debug("Check Ok")
channelResult.checkAllPodResult = models.CheckAllPodResult{
OK: &OK,
PodIP: channelResult.podIPv4,
HostIP: channelResult.hostIPv4,
Response: resp.Payload,
}
timer.ObserveDuration()
} else {
logger.Warn("Check returned error", zap.Error(err))
channelResult.checkAllPodResult = models.CheckAllPodResult{
OK: &OK,
PodIP: channelResult.podIPv4,
HostIP: channelResult.hostIPv4,
Error: err.Error(),
}
@@ -199,19 +225,17 @@ func CheckAllPods(pods map[string]string) *models.CheckAllResults {
ch <- channelResult
wg.Done()
}(podIP, hostIP)
}(pod)
}
wg.Wait()
close(ch)
for response := range ch {
var podIPv4 strfmt.IPv4
podIPv4.UnmarshalText([]byte(response.podIP))
result.Responses[response.podIP] = response.checkAllPodResult
result.Responses[response.podName] = response.checkAllPodResult
result.Hosts = append(result.Hosts, &models.CheckAllResultsHostsItems0{
HostIP: response.hostIPv4,
PodIP: podIPv4,
PodName: response.podName,
HostIP: response.hostIPv4,
PodIP: response.podIPv4,
})
if response.checkAllPodResult.Response != nil &&
response.checkAllPodResult.Response.DNSResults != nil {
@@ -222,13 +246,14 @@ func CheckAllPods(pods map[string]string) *models.CheckAllResults {
if result.DNSResults[host] == nil {
result.DNSResults[host] = make(map[string]models.DNSResult)
}
result.DNSResults[host][response.podIP] = response.checkAllPodResult.Response.DNSResults[host]
result.DNSResults[host][response.podName] = response.checkAllPodResult.Response.DNSResults[host]
}
}
}
return &result
}
// HealthCheck returns a simple 200 OK response to verify the API is up
func HealthCheck() *models.HealthCheckResults {
ok := true
start := time.Now()
@@ -244,7 +269,7 @@ func getClient(hostIP string) (*apiclient.Goldpinger, error) {
if hostIP == "" {
return nil, errors.New("Host or pod IP empty, can't make a call")
}
host := fmt.Sprintf("%s:%d", hostIP, GoldpingerConfig.Port)
host := net.JoinHostPort(hostIP, strconv.Itoa(GoldpingerConfig.Port))
transport := httptransport.New(host, "", nil)
client := apiclient.New(transport, strfmt.Default)
apiclient.Default.SetTransport(transport)

View File

@@ -20,17 +20,26 @@ import (
// GoldpingerConfig represents the configuration for goldpinger
var GoldpingerConfig = struct {
StaticFilePath string `long:"static-file-path" description:"Folder for serving static files" env:"STATIC_FILE_PATH"`
KubeConfigPath string `long:"kubeconfig" description:"Path to kubeconfig file" env:"KUBECONFIG"`
RefreshInterval int `long:"refresh-interval" description:"If > 0, will create a thread and collect stats every n seconds" env:"REFRESH_INTERVAL" default:"30"`
Hostname string `long:"hostname" description:"Hostname to use" env:"HOSTNAME"`
PodIP string `long:"pod-ip" description:"Pod IP to use" env:"POD_IP"`
PingNumber uint `long:"ping-number" description:"Number of peers to ping. A value of 0 indicates all peers should be pinged." default:"0" env:"PING_NUMBER"`
Port int `long:"client-port-override" description:"(for testing) use this port when calling other instances" env:"CLIENT_PORT_OVERRIDE"`
UseHostIP bool `long:"use-host-ip" description:"When making the calls, use host ip (defaults to pod ip)" env:"USE_HOST_IP"`
LabelSelector string `long:"label-selector" description:"label selector to use to discover goldpinger pods in the cluster" env:"LABEL_SELECTOR" default:"app=goldpinger"`
StaticFilePath string `long:"static-file-path" description:"Folder for serving static files" env:"STATIC_FILE_PATH"`
KubeConfigPath string `long:"kubeconfig" description:"Path to kubeconfig file" env:"KUBECONFIG"`
RefreshInterval int `long:"refresh-interval" description:"If > 0, will create a thread and collect stats every n seconds" env:"REFRESH_INTERVAL" default:"30"`
JitterFactor float64 `long:"jitter-factor" description:"The amount of jitter to add while pinging clients" env:"JITTER_FACTOR" default:"0.05"`
Hostname string `long:"hostname" description:"Hostname to use" env:"HOSTNAME"`
PodIP string `long:"pod-ip" description:"Pod IP to use" env:"POD_IP"`
PodName string `long:"pod-name" description:"The name of this pod - used to select --ping-number of pods using rendezvous hashing" env:"POD_NAME"`
PingNumber uint `long:"ping-number" description:"Number of peers to ping. A value of 0 indicates all peers should be pinged." default:"0" env:"PING_NUMBER"`
Port int `long:"client-port-override" description:"(for testing) use this port when calling other instances" env:"CLIENT_PORT_OVERRIDE"`
UseHostIP bool `long:"use-host-ip" description:"When making the calls, use host ip (defaults to pod ip)" env:"USE_HOST_IP"`
LabelSelector string `long:"label-selector" description:"label selector to use to discover goldpinger pods in the cluster" env:"LABEL_SELECTOR" default:"app=goldpinger"`
Namespace *string `long:"namespace" description:"namespace to use to discover goldpinger pods in the cluster (empty for all). Defaults to discovering the namespace for the current pod" env:"NAMESPACE"`
KubernetesClient *kubernetes.Clientset
*PodSelecter
DnsHosts []string `long:"host-to-resolve" description:"A host to attempt dns resolve on (space delimited)" env:"HOSTS_TO_RESOLVE" env-delim:" "`
DnsHosts []string `long:"host-to-resolve" description:"A host to attempt dns resolve on (space delimited)" env:"HOSTS_TO_RESOLVE" env-delim:" "`
IPVersions []string `long:"ip-versions" description:"The IP versions to use (space delimited). Possible values are 4 and 6 (defaults to 4)." env:"IP_VERSIONS" env-delim:" "`
// Timeouts
PingTimeoutMs int64 `long:"ping-timeout-ms" description:"The timeout in milliseconds for a ping call to other goldpinger pods" env:"PING_TIMEOUT_MS" default:"300"`
CheckTimeoutMs int64 `long:"check-timeout-ms" description:"The timeout in milliseconds for a check call to other goldpinger pods" env:"CHECK_TIMEOUT_MS" default:"1000"`
CheckAllTimeoutMs int64 `long:"check-all-timeout-ms" description:"The timeout in milliseconds for a check-all call to other goldpinger pods" env:"CHECK_ALL_TIMEOUT_MS" default:"5000"`
}{}

View File

@@ -18,15 +18,17 @@ package goldpinger
import (
"bytes"
"context"
"fmt"
"image"
"image/color"
"image/png"
"log"
"net/http"
"sort"
"strconv"
"time"
"go.uber.org/zap"
"golang.org/x/image/font"
"golang.org/x/image/font/basicfont"
"golang.org/x/image/math/fixed"
@@ -79,8 +81,14 @@ func HeatmapHandler(w http.ResponseWriter, r *http.Request) {
// parse the query to set the parameters
query := r.URL.Query()
ctx, cancel := context.WithTimeout(
r.Context(),
time.Duration(GoldpingerConfig.CheckAllTimeoutMs)*time.Millisecond,
)
defer cancel()
// get the results
checkResults := CheckAllPods(GetAllPods())
checkResults := CheckAllPods(ctx, GetAllPods())
// set some sizes
numberOfPods := len(checkResults.Responses)
@@ -135,12 +143,12 @@ func HeatmapHandler(w http.ResponseWriter, r *http.Request) {
buffer := new(bytes.Buffer)
if err := png.Encode(buffer, canvas); err != nil {
log.Println("error encoding png", err)
zap.L().Error("error encoding png", zap.Error(err))
}
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Content-Length", strconv.Itoa(len(buffer.Bytes())))
if _, err := w.Write(buffer.Bytes()); err != nil {
log.Println("error writing heatmap buffer out", err)
zap.L().Error("error writing heatmap buffer out", zap.Error(err))
}
}

View File

@@ -15,35 +15,126 @@
package goldpinger
import (
"log"
"context"
"go.uber.org/zap"
"io/ioutil"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8snet "k8s.io/utils/net"
)
func getNamespace() string {
var nodeIPMap = make(map[string]string)
// PodNamespace is the auto-detected namespace for this goldpinger pod
var PodNamespace = getPodNamespace()
// GoldpingerPod contains just the basic info needed to ping and keep track of a given goldpinger pod
type GoldpingerPod struct {
Name string // Name is the name of the pod
PodIP string // PodIP is the IP address of the pod
HostIP string // HostIP is the IP address of the host where the pod lives
}
func getPodNamespace() string {
b, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
if err != nil {
log.Println("Unable to determine namespace: ", err.Error())
zap.L().Warn("Unable to determine namespace", zap.Error(err))
return ""
}
namespace := string(b)
return namespace
}
// GetAllPods returns a map of Pod IP to Host IP based on a label selector defined in config
func GetAllPods() map[string]string {
// getHostIP gets the IP of the host where the pod is scheduled. If UseIPv6 is enabled then we need to check
// the node IPs since HostIP will only list the default IP version one.
func getHostIP(p v1.Pod) string {
if ipMatchesConfig(p.Status.HostIP) {
return p.Status.HostIP
}
if addr, ok := nodeIPMap[p.Spec.NodeName]; ok {
return addr
}
timer := GetLabeledKubernetesCallsTimer()
pods, err := GoldpingerConfig.KubernetesClient.CoreV1().Pods(getNamespace()).List(metav1.ListOptions{LabelSelector: GoldpingerConfig.LabelSelector})
node, err := GoldpingerConfig.KubernetesClient.CoreV1().Nodes().Get(context.TODO(), p.Spec.NodeName, metav1.GetOptions{})
if err != nil {
log.Println("Error getting pods for selector: ", err.Error())
zap.L().Error("error getting node", zap.Error(err))
CountError("kubernetes_api")
return p.Status.HostIP
} else {
timer.ObserveDuration()
}
var hostIP string
for _, addr := range node.Status.Addresses {
if ipMatchesConfig(addr.Address) {
hostIP = addr.Address
}
}
nodeIPMap[p.Spec.NodeName] = hostIP
return hostIP
}
// getPodIP will get an IPv6 IP from PodIPs if the UseIPv6 config is set, otherwise just return the object PodIP
func getPodIP(p v1.Pod) string {
if ipMatchesConfig(p.Status.PodIP) {
return p.Status.PodIP
}
var podIP string
if p.Status.PodIPs != nil {
for _, ip := range p.Status.PodIPs {
if ipMatchesConfig(ip.IP) {
podIP = ip.IP
}
}
}
return podIP
}
// GetAllPods returns a mapping from a pod name to a pointer to a GoldpingerPod(s)
func GetAllPods() map[string]*GoldpingerPod {
timer := GetLabeledKubernetesCallsTimer()
listOpts := metav1.ListOptions{
LabelSelector: GoldpingerConfig.LabelSelector,
FieldSelector: "status.phase=Running", // only select Running pods, otherwise we will get them before they have IPs
}
pods, err := GoldpingerConfig.KubernetesClient.CoreV1().Pods(*GoldpingerConfig.Namespace).List(context.TODO(), listOpts)
if err != nil {
zap.L().Error("Error getting pods for selector", zap.String("selector", GoldpingerConfig.LabelSelector), zap.Error(err))
CountError("kubernetes_api")
} else {
timer.ObserveDuration()
}
var podsreturn = make(map[string]string)
podMap := make(map[string]*GoldpingerPod)
for _, pod := range pods.Items {
podsreturn[pod.Status.PodIP] = pod.Status.HostIP
podMap[pod.Name] = &GoldpingerPod{
Name: pod.Name,
PodIP: getPodIP(pod),
HostIP: getHostIP(pod),
}
}
return podsreturn
return podMap
}
// ipMatchesConfig checks if the input IP family matches the first entry in the IPVersions config.
// TODO update to check all config versions to support dual-stack pinging.
func ipMatchesConfig(ip string) bool {
ipFamily := getIPFamily(ip)
return GoldpingerConfig.IPVersions[0] == string(ipFamily)
}
// getIPFamily returns the IP family of the input IP.
// Possible values are 4 and 6.
func getIPFamily(ip string) k8snet.IPFamily {
if k8snet.IsIPv4String(ip) {
return k8snet.IPv4
}
if k8snet.IsIPv6String(ip) {
return k8snet.IPv6
}
zap.L().Error("Error determining IP family", zap.String("IP", ip))
return ""
}

176
pkg/goldpinger/pinger.go Normal file
View File

@@ -0,0 +1,176 @@
// Copyright 2018 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package goldpinger
import (
"context"
"time"
"go.uber.org/zap"
apiclient "github.com/bloomberg/goldpinger/v3/pkg/client"
"github.com/bloomberg/goldpinger/v3/pkg/client/operations"
"github.com/bloomberg/goldpinger/v3/pkg/models"
"github.com/go-openapi/strfmt"
"github.com/prometheus/client_golang/prometheus"
"k8s.io/apimachinery/pkg/util/wait"
)
// Pinger contains all the info needed by a goroutine to continuously ping a pod
type Pinger struct {
pod *GoldpingerPod
client *apiclient.Goldpinger
timeout time.Duration
histogram prometheus.Observer
hostIPv4 strfmt.IPv4
podIPv4 strfmt.IPv4
resultsChan chan<- PingAllPodsResult
stopChan chan struct{}
logger *zap.Logger
}
// NewPinger constructs and returns a Pinger object responsible for pinging a single
// goldpinger pod
func NewPinger(pod *GoldpingerPod, resultsChan chan<- PingAllPodsResult) *Pinger {
p := Pinger{
pod: pod,
timeout: time.Duration(GoldpingerConfig.PingTimeoutMs) * time.Millisecond,
resultsChan: resultsChan,
stopChan: make(chan struct{}),
histogram: goldpingerResponseTimePeersHistogram.WithLabelValues(
GoldpingerConfig.Hostname,
"ping",
pod.HostIP,
pod.PodIP,
),
logger: zap.L().With(
zap.String("op", "pinger"),
zap.String("name", pod.Name),
zap.String("hostIP", pod.HostIP),
zap.String("podIP", pod.PodIP),
),
}
// Initialize the host/pod IPv4
p.hostIPv4.UnmarshalText([]byte(pod.HostIP))
p.podIPv4.UnmarshalText([]byte(pod.PodIP))
return &p
}
// getClient returns a client that can be used to ping the given pod
// On error, it returns a static result
func (p *Pinger) getClient() (*apiclient.Goldpinger, error) {
if p.client != nil {
return p.client, nil
}
client, err := getClient(pickPodHostIP(p.pod.PodIP, p.pod.HostIP))
if err != nil {
p.logger.Warn("Could not get client", zap.Error(err))
OK := false
p.resultsChan <- PingAllPodsResult{
podName: p.pod.Name,
podResult: models.PodResult{
PingTime: strfmt.DateTime(time.Now()),
PodIP: p.podIPv4,
HostIP: p.hostIPv4,
OK: &OK,
Error: err.Error(),
StatusCode: 500,
ResponseTimeMs: 0,
},
}
return nil, err
}
p.client = client
return p.client, nil
}
// Ping makes a single ping request to the given pod
func (p *Pinger) Ping() {
client, err := p.getClient()
if err != nil {
return
}
CountCall("made", "ping")
start := time.Now()
ctx, cancel := context.WithTimeout(context.Background(), p.timeout)
defer cancel()
params := operations.NewPingParamsWithContext(ctx)
resp, err := client.Operations.Ping(params)
responseTime := time.Since(start)
responseTimeMs := responseTime.Nanoseconds() / int64(time.Millisecond)
p.histogram.Observe(responseTime.Seconds())
OK := (err == nil)
if OK {
p.resultsChan <- PingAllPodsResult{
podName: p.pod.Name,
podResult: models.PodResult{
PingTime: strfmt.DateTime(start),
PodIP: p.podIPv4,
HostIP: p.hostIPv4,
OK: &OK,
Response: resp.Payload,
StatusCode: 200,
ResponseTimeMs: responseTimeMs,
},
}
p.logger.Debug("Success pinging pod", zap.Duration("responseTime", responseTime))
} else {
p.resultsChan <- PingAllPodsResult{
podName: p.pod.Name,
podResult: models.PodResult{
PingTime: strfmt.DateTime(start),
PodIP: p.podIPv4,
HostIP: p.hostIPv4,
OK: &OK,
Error: err.Error(),
StatusCode: 504,
ResponseTimeMs: responseTimeMs,
},
}
p.logger.Warn("Ping returned error", zap.Duration("responseTime", responseTime), zap.Error(err))
CountError("ping")
}
}
// PingContinuously continuously pings the given pod with a delay between
// `period` and `period + jitterFactor * period`
func (p *Pinger) PingContinuously(initialWait time.Duration, period time.Duration, jitterFactor float64) {
p.logger.Info(
"Starting pinger",
zap.Duration("period", period),
zap.Duration("initialWait", initialWait),
zap.Float64("jitterFactor", jitterFactor),
)
timer := time.NewTimer(initialWait)
select {
case <-timer.C:
wait.JitterUntil(p.Ping, period, jitterFactor, false, p.stopChan)
case <-p.stopChan:
// Do nothing
}
// We are done, send a message on the results channel to delete this
p.resultsChan <- PingAllPodsResult{podName: p.pod.Name, deleted: true}
}

View File

@@ -19,43 +19,22 @@ import (
rendezvous "github.com/stuartnelson3/go-rendezvous"
)
// PodSelecter selects the result of getPods() down to count instances
// according to a rendezvous hash.
type PodSelecter struct {
count uint
podIP string
getPods func() map[string]string
}
// NewPodSelecter creates a new PodSelecter struct.
func NewPodSelecter(count uint, podIP string, getPods func() map[string]string) *PodSelecter {
if podIP == "" {
// If podIP is blank, then we can't use the rendezvous hash to
// assign the IP correctly. Setting count=0 will force all pods
// to be pinged.
count = 0
}
return &PodSelecter{
count: count,
podIP: podIP,
getPods: getPods,
}
}
// SelectPods returns a map of pods filtered according to its configuration.
func (p *PodSelecter) SelectPods() map[string]string {
allPods := p.getPods()
if p.count == 0 || p.count >= uint(len(allPods)) {
// SelectPods selects a set of pods from the results of GetAllPods
// depending on the count according to a rendezvous hash
func SelectPods() map[string]*GoldpingerPod {
allPods := GetAllPods()
if GoldpingerConfig.PingNumber <= 0 || int(GoldpingerConfig.PingNumber) >= len(allPods) {
return allPods
}
rzv := rendezvous.New([]string{}, rendezvous.Hasher(xxhash.Sum64String))
for podIP := range allPods {
rzv.Add(podIP)
for podName := range allPods {
rzv.Add(podName)
}
matches := rzv.LookupN(p.podIP, p.count)
toPing := make(map[string]string)
for _, podIP := range matches {
toPing[podIP] = allPods[podIP]
matches := rzv.LookupN(GoldpingerConfig.PodName, GoldpingerConfig.PingNumber)
toPing := make(map[string]*GoldpingerPod)
for _, podName := range matches {
toPing[podName] = allPods[podName]
}
return toPing
}

View File

@@ -15,12 +15,13 @@
package goldpinger
import (
"log"
"context"
"time"
"github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
"github.com/go-openapi/strfmt"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
)
var (
@@ -47,6 +48,16 @@ var (
},
)
goldpingerClusterHealthGauge = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "goldpinger_cluster_health_total",
Help: "1 if all check pass, 0 otherwise",
},
[]string{
"goldpinger_instance",
},
)
goldpingerResponseTimePeersHistogram = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "goldpinger_peers_response_time_s",
@@ -99,14 +110,15 @@ var (
func init() {
prometheus.MustRegister(goldpingerStatsCounter)
prometheus.MustRegister(goldpingerNodesHealthGauge)
prometheus.MustRegister(goldpingerClusterHealthGauge)
prometheus.MustRegister(goldpingerResponseTimePeersHistogram)
prometheus.MustRegister(goldpingerResponseTimeKubernetesHistogram)
prometheus.MustRegister(goldpingerErrorsCounter)
prometheus.MustRegister(goldpingerDnsErrorsCounter)
log.Println("Metrics setup - see /metrics")
zap.L().Info("Metrics setup - see /metrics")
}
func GetStats() *models.PingResults {
func GetStats(ctx context.Context) *models.PingResults {
// GetStats no longer populates the received and made calls - use metrics for that instead
return &models.PingResults{
BootTime: strfmt.DateTime(bootTime),
@@ -134,6 +146,17 @@ func CountHealthyUnhealthyNodes(healthy, unhealthy float64) {
).Set(unhealthy)
}
// SetClusterHealth sets the cluster health gauge to 1 (healthy) or 0 (unhealthy)
func SetClusterHealth(healthy bool) {
value := 1.0
if !healthy {
value = 0
}
goldpingerClusterHealthGauge.WithLabelValues(
GoldpingerConfig.Hostname,
).Set(value)
}
// counts instances of various errors
func CountError(errorType string) {
goldpingerErrorsCounter.WithLabelValues(

View File

@@ -15,31 +15,192 @@
package goldpinger
import (
"fmt"
"log"
"sync"
"time"
"go.uber.org/zap"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// checkResults holds the latest results of checking the pods
var checkResults = models.CheckResults{PodResults: make(map[string]models.PodResult)}
// checkResultsMux controls concurrent access to checkResults
var checkResultsMux = sync.Mutex{}
// exists checks whether there is an existing pinger for the given pod
// returns true if:
// - there is already a pinger with the same name
// - the pinger has the same podIP
// - the pinger has the same hostIP
func exists(existingPods map[string]*GoldpingerPod, new *GoldpingerPod) bool {
old, exists := existingPods[new.Name]
return exists && (old.PodIP == new.PodIP) && (old.HostIP == new.HostIP)
}
// updatePingers calls SelectPods() at regular intervals to get a new list of goldpinger pods to ping
// For each goldpinger pod, it then creates a pinger responsible for pinging it and returning the
// results on the result channel
func updatePingers(resultsChan chan<- PingAllPodsResult) {
// Important: This is the only goroutine that should have access to
// these maps since there is nothing controlling concurrent access
pingers := make(map[string]*Pinger)
existingPods := make(map[string]*GoldpingerPod)
refreshPeriod := time.Duration(GoldpingerConfig.RefreshInterval) * time.Second
for {
// Initialize deletedPods to all existing pods, we will remove
// any pods that should still exist from this list after we are done
// NOTE: This is *NOT* a copy of existingPods just a new variable name
// to make the intention/code clear and cleaner
deletedPods := existingPods
// New pods are brand new and haven't been seen before
newPods := make(map[string]*GoldpingerPod)
latest := SelectPods()
for podName, pod := range latest {
if exists(existingPods, pod) {
// This pod continues to exist in the latest iteration of the update
// without any changes
// Delete it from the set of pods that we wish to delete
delete(deletedPods, podName)
} else {
// This pod is brand new and has never been seen before
// Add it to the list of newPods
newPods[podName] = pod
}
}
// deletedPods now contains any pods that have either been deleted from the api-server
// *OR* weren't selected by our rendezvous hash
// *OR* had their host/pod IP changed. Remove those pingers
destroyPingers(pingers, deletedPods)
// Next create pingers for new pods
createPingers(pingers, newPods, resultsChan, refreshPeriod)
// Finally, just set existingPods to the latest and collect garbage
existingPods = latest
deletedPods = nil
newPods = nil
// Wait the given time before pinging
time.Sleep(refreshPeriod)
}
}
// createPingers allocates a new pinger object for each new goldpinger Pod that's been discovered
// It also:
// (a) initializes a result object in checkResults to store info on that pod
// (b) starts a new goroutines to continuously ping the given pod.
// Each new goroutine waits for a given time before starting the continuous ping
// to prevent a thundering herd
func createPingers(pingers map[string]*Pinger, newPods map[string]*GoldpingerPod, resultsChan chan<- PingAllPodsResult, refreshPeriod time.Duration) {
if len(newPods) == 0 {
// I have nothing to do
return
}
waitBetweenPods := refreshPeriod / time.Duration(len(newPods))
zap.L().Info(
"Starting pingers for new pods",
zap.Int("numNewPods", len(newPods)),
zap.Duration("refreshPeriod", refreshPeriod),
zap.Duration("waitPeriod", waitBetweenPods),
zap.Float64("JitterFactor", GoldpingerConfig.JitterFactor),
)
initialWait := time.Duration(0)
for podName, pod := range newPods {
pinger := NewPinger(pod, resultsChan)
pingers[podName] = pinger
go pinger.PingContinuously(initialWait, refreshPeriod, GoldpingerConfig.JitterFactor)
initialWait += waitBetweenPods
}
}
// destroyPingers takes a list of deleted pods and then for each pod in the list, it stops
// the goroutines that continuously pings that pod and then deletes the pod from the list of pingers
func destroyPingers(pingers map[string]*Pinger, deletedPods map[string]*GoldpingerPod) {
for podName, pod := range deletedPods {
zap.L().Info(
"Deleting pod from pingers",
zap.String("name", podName),
zap.String("podIP", pod.PodIP),
zap.String("hostIP", pod.HostIP),
)
pinger := pingers[podName]
// Close the channel to stop pinging
close(pinger.stopChan)
// delete from pingers
delete(pingers, podName)
}
}
// updateCounters updates the count of health and unhealthy nodes
func updateCounters() {
checkResultsMux.Lock()
defer checkResultsMux.Unlock()
var counterHealthy float64
for _, result := range checkResults.PodResults {
if result.OK != nil && *result.OK {
counterHealthy++
}
}
CountHealthyUnhealthyNodes(counterHealthy, float64(len(checkResults.PodResults))-counterHealthy)
// check DNS, but don't block the access to checkResultsMux
nodesHealthy := int(counterHealthy) == len(checkResults.PodResults)
go func(healthySoFar bool) {
if healthySoFar {
for _, response := range *checkDNS() {
if response.Error != "" {
healthySoFar = false
break
}
}
}
SetClusterHealth(healthySoFar)
}(nodesHealthy)
}
// collectResults simply reads results from the results channel and saves them in a map
func collectResults(resultsChan <-chan PingAllPodsResult) {
refreshPeriod := time.Duration(GoldpingerConfig.RefreshInterval) * time.Second
updateTicker := time.NewTicker(refreshPeriod)
for {
select {
case <-updateTicker.C:
// Every time our update ticker ticks, update the count of healthy/unhealthy nodes
updateCounters()
case response := <-resultsChan:
// On getting a ping response, if the pinger is not being deleted,
// simply save it for later
checkResultsMux.Lock()
if response.deleted {
delete(checkResults.PodResults, response.podName)
} else {
checkResults.PodResults[response.podName] = response.podResult
}
checkResultsMux.Unlock()
}
}
}
func StartUpdater() {
if GoldpingerConfig.RefreshInterval <= 0 {
log.Println("Not creating updater, period is 0")
zap.L().Info("Not creating updater, refresh interval is negative", zap.Int("RefreshInterval", GoldpingerConfig.RefreshInterval))
return
}
// start the updater
go func() {
for {
results := PingAllPods(GoldpingerConfig.PodSelecter.SelectPods())
var troublemakers []string
for podIP, value := range results.PodResults {
if *value.OK != true {
troublemakers = append(troublemakers, fmt.Sprintf("%s (%s)", podIP, value.HostIP.String()))
}
}
if len(troublemakers) > 0 {
log.Println("Updater ran into trouble with these peers: ", troublemakers)
}
time.Sleep(time.Duration(GoldpingerConfig.RefreshInterval) * time.Second)
}
}()
pods := SelectPods()
// Create a channel for the results
resultsChan := make(chan PingAllPodsResult, len(pods))
go updatePingers(resultsChan)
go collectResults(resultsChan)
}

View File

@@ -6,12 +6,14 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CallStats call stats
//
// swagger:model CallStats
type CallStats struct {
@@ -30,6 +32,11 @@ func (m *CallStats) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this call stats based on context it is used
func (m *CallStats) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CallStats) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -6,14 +6,16 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// CheckAllPodResult check all pod result
//
// swagger:model CheckAllPodResult
type CheckAllPodResult struct {
@@ -24,6 +26,10 @@ type CheckAllPodResult struct {
// o k
OK *bool `json:"OK,omitempty"`
// pod IP
// Format: ipv4
PodIP strfmt.IPv4 `json:"PodIP,omitempty"`
// error
Error string `json:"error,omitempty"`
@@ -42,6 +48,10 @@ func (m *CheckAllPodResult) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validatePodIP(formats); err != nil {
res = append(res, err)
}
if err := m.validateResponse(formats); err != nil {
res = append(res, err)
}
@@ -53,7 +63,6 @@ func (m *CheckAllPodResult) Validate(formats strfmt.Registry) error {
}
func (m *CheckAllPodResult) validateHostIP(formats strfmt.Registry) error {
if swag.IsZero(m.HostIP) { // not required
return nil
}
@@ -65,8 +74,19 @@ func (m *CheckAllPodResult) validateHostIP(formats strfmt.Registry) error {
return nil
}
func (m *CheckAllPodResult) validateResponse(formats strfmt.Registry) error {
func (m *CheckAllPodResult) validatePodIP(formats strfmt.Registry) error {
if swag.IsZero(m.PodIP) { // not required
return nil
}
if err := validate.FormatOf("PodIP", "body", "ipv4", m.PodIP.String(), formats); err != nil {
return err
}
return nil
}
func (m *CheckAllPodResult) validateResponse(formats strfmt.Registry) error {
if swag.IsZero(m.Response) { // not required
return nil
}
@@ -83,6 +103,34 @@ func (m *CheckAllPodResult) validateResponse(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this check all pod result based on the context it is used
func (m *CheckAllPodResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResponse(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CheckAllPodResult) contextValidateResponse(ctx context.Context, formats strfmt.Registry) error {
if m.Response != nil {
if err := m.Response.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("response")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CheckAllPodResult) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -6,16 +6,17 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// CheckAllResults check all results
//
// swagger:model CheckAllResults
type CheckAllResults struct {
@@ -61,7 +62,6 @@ func (m *CheckAllResults) Validate(formats strfmt.Registry) error {
}
func (m *CheckAllResults) validateDNSResults(formats strfmt.Registry) error {
if swag.IsZero(m.DNSResults) { // not required
return nil
}
@@ -80,7 +80,6 @@ func (m *CheckAllResults) validateDNSResults(formats strfmt.Registry) error {
}
func (m *CheckAllResults) validateHosts(formats strfmt.Registry) error {
if swag.IsZero(m.Hosts) { // not required
return nil
}
@@ -105,7 +104,6 @@ func (m *CheckAllResults) validateHosts(formats strfmt.Registry) error {
}
func (m *CheckAllResults) validateResponses(formats strfmt.Registry) error {
if swag.IsZero(m.Responses) { // not required
return nil
}
@@ -126,6 +124,76 @@ func (m *CheckAllResults) validateResponses(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this check all results based on the context it is used
func (m *CheckAllResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDNSResults(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateHosts(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateResponses(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CheckAllResults) contextValidateDNSResults(ctx context.Context, formats strfmt.Registry) error {
for k := range m.DNSResults {
if val, ok := m.DNSResults[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
func (m *CheckAllResults) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Hosts); i++ {
if m.Hosts[i] != nil {
if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("hosts" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CheckAllResults) contextValidateResponses(ctx context.Context, formats strfmt.Registry) error {
for k := range m.Responses {
if val, ok := m.Responses[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CheckAllResults) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -145,6 +213,7 @@ func (m *CheckAllResults) UnmarshalBinary(b []byte) error {
}
// CheckAllResultsHostsItems0 check all results hosts items0
//
// swagger:model CheckAllResultsHostsItems0
type CheckAllResultsHostsItems0 struct {
@@ -155,6 +224,9 @@ type CheckAllResultsHostsItems0 struct {
// pod IP
// Format: ipv4
PodIP strfmt.IPv4 `json:"podIP,omitempty"`
// pod name
PodName string `json:"podName,omitempty"`
}
// Validate validates this check all results hosts items0
@@ -176,7 +248,6 @@ func (m *CheckAllResultsHostsItems0) Validate(formats strfmt.Registry) error {
}
func (m *CheckAllResultsHostsItems0) validateHostIP(formats strfmt.Registry) error {
if swag.IsZero(m.HostIP) { // not required
return nil
}
@@ -189,7 +260,6 @@ func (m *CheckAllResultsHostsItems0) validateHostIP(formats strfmt.Registry) err
}
func (m *CheckAllResultsHostsItems0) validatePodIP(formats strfmt.Registry) error {
if swag.IsZero(m.PodIP) { // not required
return nil
}
@@ -201,6 +271,11 @@ func (m *CheckAllResultsHostsItems0) validatePodIP(formats strfmt.Registry) erro
return nil
}
// ContextValidate validates this check all results hosts items0 based on context it is used
func (m *CheckAllResultsHostsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CheckAllResultsHostsItems0) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -6,14 +6,16 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// CheckResults check results
//
// swagger:model CheckResults
type CheckResults struct {
@@ -43,23 +45,23 @@ func (m *CheckResults) Validate(formats strfmt.Registry) error {
}
func (m *CheckResults) validateDNSResults(formats strfmt.Registry) error {
if swag.IsZero(m.DNSResults) { // not required
return nil
}
if err := m.DNSResults.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("dnsResults")
if m.DNSResults != nil {
if err := m.DNSResults.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("dnsResults")
}
return err
}
return err
}
return nil
}
func (m *CheckResults) validatePodResults(formats strfmt.Registry) error {
if swag.IsZero(m.PodResults) { // not required
return nil
}
@@ -80,6 +82,51 @@ func (m *CheckResults) validatePodResults(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this check results based on the context it is used
func (m *CheckResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDNSResults(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePodResults(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CheckResults) contextValidateDNSResults(ctx context.Context, formats strfmt.Registry) error {
if err := m.DNSResults.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("dnsResults")
}
return err
}
return nil
}
func (m *CheckResults) contextValidatePodResults(ctx context.Context, formats strfmt.Registry) error {
for k := range m.PodResults {
if val, ok := m.PodResults[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CheckResults) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,103 @@
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// ClusterHealthResults cluster health results
//
// swagger:model ClusterHealthResults
type ClusterHealthResults struct {
// o k
// Required: true
OK bool `json:"OK"`
// duration ns
DurationNs int64 `json:"duration-ns,omitempty"`
// generated at
// Format: date-time
GeneratedAt strfmt.DateTime `json:"generated-at,omitempty"`
// nodes healthy
NodesHealthy []string `json:"nodesHealthy"`
// nodes total
NodesTotal int64 `json:"nodesTotal,omitempty"`
// nodes unhealthy
NodesUnhealthy []string `json:"nodesUnhealthy"`
}
// Validate validates this cluster health results
func (m *ClusterHealthResults) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOK(formats); err != nil {
res = append(res, err)
}
if err := m.validateGeneratedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ClusterHealthResults) validateOK(formats strfmt.Registry) error {
if err := validate.Required("OK", "body", bool(m.OK)); err != nil {
return err
}
return nil
}
func (m *ClusterHealthResults) validateGeneratedAt(formats strfmt.Registry) error {
if swag.IsZero(m.GeneratedAt) { // not required
return nil
}
if err := validate.FormatOf("generated-at", "body", "date-time", m.GeneratedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this cluster health results based on context it is used
func (m *ClusterHealthResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ClusterHealthResults) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ClusterHealthResults) UnmarshalBinary(b []byte) error {
var res ClusterHealthResults
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -6,12 +6,14 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DNSResult Dns result
//
// swagger:model DnsResult
type DNSResult struct {
@@ -27,6 +29,11 @@ func (m *DNSResult) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this Dns result based on context it is used
func (m *DNSResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DNSResult) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -6,13 +6,15 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// DNSResults Dns results
//
// swagger:model DnsResults
type DNSResults map[string]DNSResult
@@ -38,3 +40,23 @@ func (m DNSResults) Validate(formats strfmt.Registry) error {
}
return nil
}
// ContextValidate validate this Dns results based on the context it is used
func (m DNSResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
for k := range m {
if val, ok := m[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -6,14 +6,16 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// HealthCheckResults health check results
//
// swagger:model HealthCheckResults
type HealthCheckResults struct {
@@ -43,7 +45,6 @@ func (m *HealthCheckResults) Validate(formats strfmt.Registry) error {
}
func (m *HealthCheckResults) validateGeneratedAt(formats strfmt.Registry) error {
if swag.IsZero(m.GeneratedAt) { // not required
return nil
}
@@ -55,6 +56,11 @@ func (m *HealthCheckResults) validateGeneratedAt(formats strfmt.Registry) error
return nil
}
// ContextValidate validates this health check results based on context it is used
func (m *HealthCheckResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *HealthCheckResults) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -6,14 +6,16 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// PingResults ping results
//
// swagger:model PingResults
type PingResults struct {
@@ -44,7 +46,6 @@ func (m *PingResults) Validate(formats strfmt.Registry) error {
}
func (m *PingResults) validateBootTime(formats strfmt.Registry) error {
if swag.IsZero(m.BootTime) { // not required
return nil
}
@@ -57,7 +58,6 @@ func (m *PingResults) validateBootTime(formats strfmt.Registry) error {
}
func (m *PingResults) validateReceived(formats strfmt.Registry) error {
if swag.IsZero(m.Received) { // not required
return nil
}
@@ -74,6 +74,34 @@ func (m *PingResults) validateReceived(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this ping results based on the context it is used
func (m *PingResults) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateReceived(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *PingResults) contextValidateReceived(ctx context.Context, formats strfmt.Registry) error {
if m.Received != nil {
if err := m.Received.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("received")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *PingResults) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -6,14 +6,16 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// PodResult pod result
//
// swagger:model PodResult
type PodResult struct {
@@ -24,6 +26,14 @@ type PodResult struct {
// o k
OK *bool `json:"OK,omitempty"`
// ping time
// Format: date-time
PingTime strfmt.DateTime `json:"PingTime,omitempty"`
// pod IP
// Format: ipv4
PodIP strfmt.IPv4 `json:"PodIP,omitempty"`
// error
Error string `json:"error,omitempty"`
@@ -45,6 +55,14 @@ func (m *PodResult) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validatePingTime(formats); err != nil {
res = append(res, err)
}
if err := m.validatePodIP(formats); err != nil {
res = append(res, err)
}
if err := m.validateResponse(formats); err != nil {
res = append(res, err)
}
@@ -56,7 +74,6 @@ func (m *PodResult) Validate(formats strfmt.Registry) error {
}
func (m *PodResult) validateHostIP(formats strfmt.Registry) error {
if swag.IsZero(m.HostIP) { // not required
return nil
}
@@ -68,8 +85,31 @@ func (m *PodResult) validateHostIP(formats strfmt.Registry) error {
return nil
}
func (m *PodResult) validateResponse(formats strfmt.Registry) error {
func (m *PodResult) validatePingTime(formats strfmt.Registry) error {
if swag.IsZero(m.PingTime) { // not required
return nil
}
if err := validate.FormatOf("PingTime", "body", "date-time", m.PingTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *PodResult) validatePodIP(formats strfmt.Registry) error {
if swag.IsZero(m.PodIP) { // not required
return nil
}
if err := validate.FormatOf("PodIP", "body", "ipv4", m.PodIP.String(), formats); err != nil {
return err
}
return nil
}
func (m *PodResult) validateResponse(formats strfmt.Registry) error {
if swag.IsZero(m.Response) { // not required
return nil
}
@@ -86,6 +126,34 @@ func (m *PodResult) validateResponse(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this pod result based on the context it is used
func (m *PodResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResponse(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *PodResult) contextValidateResponse(ctx context.Context, formats strfmt.Registry) error {
if m.Response != nil {
if err := m.Response.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("response")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *PodResult) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -17,18 +17,20 @@
package restapi
import (
"context"
"crypto/tls"
"log"
"net/http"
"time"
"strings"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"go.uber.org/zap"
"github.com/bloomberg/goldpinger/pkg/goldpinger"
"github.com/bloomberg/goldpinger/pkg/restapi/operations"
"github.com/bloomberg/goldpinger/v3/pkg/goldpinger"
"github.com/bloomberg/goldpinger/v3/pkg/restapi/operations"
"github.com/go-openapi/swag"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@@ -47,7 +49,7 @@ func configureFlags(api *operations.GoldpingerAPI) {
func configureAPI(api *operations.GoldpingerAPI) http.Handler {
// configure the api here
ps := goldpinger.GoldpingerConfig.PodSelecter
api.Logger = zap.S().Infof
api.ServeError = errors.ServeError
api.JSONConsumer = runtime.JSONConsumer()
@@ -56,19 +58,58 @@ func configureAPI(api *operations.GoldpingerAPI) http.Handler {
api.PingHandler = operations.PingHandlerFunc(
func(params operations.PingParams) middleware.Responder {
goldpinger.CountCall("received", "ping")
return operations.NewPingOK().WithPayload(goldpinger.GetStats())
ctx, cancel := context.WithTimeout(
params.HTTPRequest.Context(),
time.Duration(goldpinger.GoldpingerConfig.PingTimeoutMs)*time.Millisecond,
)
defer cancel()
return operations.NewPingOK().WithPayload(goldpinger.GetStats(ctx))
})
api.CheckServicePodsHandler = operations.CheckServicePodsHandlerFunc(
func(params operations.CheckServicePodsParams) middleware.Responder {
goldpinger.CountCall("received", "check")
return operations.NewCheckServicePodsOK().WithPayload(goldpinger.CheckNeighbours(ps))
ctx, cancel := context.WithTimeout(
params.HTTPRequest.Context(),
time.Duration(goldpinger.GoldpingerConfig.CheckTimeoutMs)*time.Millisecond,
)
defer cancel()
return operations.NewCheckServicePodsOK().WithPayload(goldpinger.CheckNeighbours(ctx))
})
api.CheckAllPodsHandler = operations.CheckAllPodsHandlerFunc(
func(params operations.CheckAllPodsParams) middleware.Responder {
goldpinger.CountCall("received", "check_all")
return operations.NewCheckAllPodsOK().WithPayload(goldpinger.CheckNeighboursNeighbours(ps))
ctx, cancel := context.WithTimeout(
params.HTTPRequest.Context(),
time.Duration(goldpinger.GoldpingerConfig.CheckAllTimeoutMs)*time.Millisecond,
)
defer cancel()
return operations.NewCheckAllPodsOK().WithPayload(goldpinger.CheckNeighboursNeighbours(ctx))
})
api.ClusterHealthHandler = operations.ClusterHealthHandlerFunc(
func(params operations.ClusterHealthParams) middleware.Responder {
goldpinger.CountCall("received", "cluster_health")
ctx, cancel := context.WithTimeout(
params.HTTPRequest.Context(),
time.Duration(goldpinger.GoldpingerConfig.CheckAllTimeoutMs)*time.Millisecond,
)
defer cancel()
payload := goldpinger.CheckCluster(ctx)
if payload.OK {
return operations.NewClusterHealthOK().WithPayload(payload)
} else {
return operations.NewClusterHealthIMATeapot().WithPayload(payload)
}
})
api.HealthzHandler = operations.HealthzHandlerFunc(
@@ -106,7 +147,7 @@ func setupMiddlewares(handler http.Handler) http.Handler {
}
func fileServerMiddleware(next http.Handler) http.Handler {
log.Println("Added the static middleware")
zap.L().Info("Added the static middleware")
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fileServer := http.FileServer(http.Dir(goldpinger.GoldpingerConfig.StaticFilePath))
if r.URL.Path == "/" {
@@ -123,7 +164,7 @@ func fileServerMiddleware(next http.Handler) http.Handler {
}
func prometheusMetricsMiddleware(next http.Handler) http.Handler {
log.Println("Added the prometheus middleware")
zap.L().Info("Added the prometheus middleware")
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/metrics" {
http.StripPrefix("/metrics", promhttp.Handler()).ServeHTTP(w, r)

View File

@@ -1,20 +1,18 @@
// Code generated by go-swagger; DO NOT EDIT.
/*
Package restapi Goldpinger
Schemes:
http
Host: localhost
BasePath: /
Version: 2.0.0
Consumes:
- application/json
Produces:
- application/json
swagger:meta
*/
// Package restapi Goldpinger
//
// Schemes:
// http
// Host: localhost
// BasePath: /
// Version: 3.0.0
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// swagger:meta
package restapi

View File

@@ -21,7 +21,7 @@ func init() {
"swagger": "2.0",
"info": {
"title": "Goldpinger",
"version": "2.0.0"
"version": "3.0.0"
},
"paths": {
"/check": {
@@ -58,6 +58,29 @@ func init() {
}
}
},
"/cluster_health": {
"get": {
"description": "Checks the full graph. Returns a binary OK or not OK.",
"produces": [
"application/json"
],
"operationId": "clusterHealth",
"responses": {
"200": {
"description": "Healthy cluster",
"schema": {
"$ref": "#/definitions/ClusterHealthResults"
}
},
"418": {
"description": "Unhealthy cluster",
"schema": {
"$ref": "#/definitions/ClusterHealthResults"
}
}
}
}
},
"/healthz": {
"get": {
"description": "The healthcheck endpoint provides detailed information about the health of a web service. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.",
@@ -124,6 +147,10 @@ func init() {
"type": "boolean",
"default": false
},
"PodIP": {
"type": "string",
"format": "ipv4"
},
"error": {
"type": "string"
},
@@ -161,6 +188,9 @@ func init() {
"podIP": {
"type": "string",
"format": "ipv4"
},
"podName": {
"type": "string"
}
}
}
@@ -195,6 +225,42 @@ func init() {
}
}
},
"ClusterHealthResults": {
"type": "object",
"required": [
"OK"
],
"properties": {
"OK": {
"type": "boolean",
"default": false
},
"duration-ns": {
"type": "integer",
"format": "int64"
},
"generated-at": {
"type": "string",
"format": "date-time"
},
"nodesHealthy": {
"type": "array",
"items": {
"type": "string"
}
},
"nodesTotal": {
"type": "integer",
"format": "int64"
},
"nodesUnhealthy": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"DnsResult": {
"properties": {
"error": {
@@ -252,6 +318,14 @@ func init() {
"type": "boolean",
"default": false
},
"PingTime": {
"type": "string",
"format": "date-time"
},
"PodIP": {
"type": "string",
"format": "ipv4"
},
"error": {
"type": "string"
},
@@ -275,7 +349,7 @@ func init() {
"swagger": "2.0",
"info": {
"title": "Goldpinger",
"version": "2.0.0"
"version": "3.0.0"
},
"paths": {
"/check": {
@@ -312,6 +386,29 @@ func init() {
}
}
},
"/cluster_health": {
"get": {
"description": "Checks the full graph. Returns a binary OK or not OK.",
"produces": [
"application/json"
],
"operationId": "clusterHealth",
"responses": {
"200": {
"description": "Healthy cluster",
"schema": {
"$ref": "#/definitions/ClusterHealthResults"
}
},
"418": {
"description": "Unhealthy cluster",
"schema": {
"$ref": "#/definitions/ClusterHealthResults"
}
}
}
}
},
"/healthz": {
"get": {
"description": "The healthcheck endpoint provides detailed information about the health of a web service. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.",
@@ -378,6 +475,10 @@ func init() {
"type": "boolean",
"default": false
},
"PodIP": {
"type": "string",
"format": "ipv4"
},
"error": {
"type": "string"
},
@@ -406,17 +507,7 @@ func init() {
"hosts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"hostIP": {
"type": "string",
"format": "ipv4"
},
"podIP": {
"type": "string",
"format": "ipv4"
}
}
"$ref": "#/definitions/CheckAllResultsHostsItems0"
}
},
"hosts-healthy": {
@@ -435,6 +526,22 @@ func init() {
}
}
},
"CheckAllResultsHostsItems0": {
"type": "object",
"properties": {
"hostIP": {
"type": "string",
"format": "ipv4"
},
"podIP": {
"type": "string",
"format": "ipv4"
},
"podName": {
"type": "string"
}
}
},
"CheckResults": {
"type": "object",
"properties": {
@@ -449,6 +556,42 @@ func init() {
}
}
},
"ClusterHealthResults": {
"type": "object",
"required": [
"OK"
],
"properties": {
"OK": {
"type": "boolean",
"default": false
},
"duration-ns": {
"type": "integer",
"format": "int64"
},
"generated-at": {
"type": "string",
"format": "date-time"
},
"nodesHealthy": {
"type": "array",
"items": {
"type": "string"
}
},
"nodesTotal": {
"type": "integer",
"format": "int64"
},
"nodesUnhealthy": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"DnsResult": {
"properties": {
"error": {
@@ -506,6 +649,14 @@ func init() {
"type": "boolean",
"default": false
},
"PingTime": {
"type": "string",
"format": "date-time"
},
"PodIP": {
"type": "string",
"format": "ipv4"
},
"error": {
"type": "string"
},

View File

@@ -8,7 +8,7 @@ package operations
import (
"net/http"
middleware "github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/runtime/middleware"
)
// CheckAllPodsHandlerFunc turns a function with the right signature into a check all pods handler
@@ -29,7 +29,7 @@ func NewCheckAllPods(ctx *middleware.Context, handler CheckAllPodsHandler) *Chec
return &CheckAllPods{Context: ctx, Handler: handler}
}
/*CheckAllPods swagger:route GET /check_all checkAllPods
/* CheckAllPods swagger:route GET /check_all checkAllPods
Queries the API server for all other pods in this service, and makes all of them query all of their neighbours, using their pods IPs. Calls their /check endpoint.
@@ -45,14 +45,12 @@ func (o *CheckAllPods) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewCheckAllPodsParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -13,7 +13,8 @@ import (
)
// NewCheckAllPodsParams creates a new CheckAllPodsParams object
// no default values defined in spec.
//
// There are no default values defined in the spec.
func NewCheckAllPodsParams() CheckAllPodsParams {
return CheckAllPodsParams{}

View File

@@ -10,7 +10,7 @@ import (
"github.com/go-openapi/runtime"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// CheckAllPodsOKCode is the HTTP code returned for type CheckAllPodsOK

View File

@@ -8,7 +8,7 @@ package operations
import (
"net/http"
middleware "github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/runtime/middleware"
)
// CheckServicePodsHandlerFunc turns a function with the right signature into a check service pods handler
@@ -29,7 +29,7 @@ func NewCheckServicePods(ctx *middleware.Context, handler CheckServicePodsHandle
return &CheckServicePods{Context: ctx, Handler: handler}
}
/*CheckServicePods swagger:route GET /check checkServicePods
/* CheckServicePods swagger:route GET /check checkServicePods
Queries the API server for all other pods in this service, and pings them via their pods IPs. Calls their /ping endpoint
@@ -45,14 +45,12 @@ func (o *CheckServicePods) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewCheckServicePodsParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -13,7 +13,8 @@ import (
)
// NewCheckServicePodsParams creates a new CheckServicePodsParams object
// no default values defined in spec.
//
// There are no default values defined in the spec.
func NewCheckServicePodsParams() CheckServicePodsParams {
return CheckServicePodsParams{}

View File

@@ -10,7 +10,7 @@ import (
"github.com/go-openapi/runtime"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// CheckServicePodsOKCode is the HTTP code returned for type CheckServicePodsOK

View File

@@ -0,0 +1,56 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
)
// ClusterHealthHandlerFunc turns a function with the right signature into a cluster health handler
type ClusterHealthHandlerFunc func(ClusterHealthParams) middleware.Responder
// Handle executing the request and returning a response
func (fn ClusterHealthHandlerFunc) Handle(params ClusterHealthParams) middleware.Responder {
return fn(params)
}
// ClusterHealthHandler interface for that can handle valid cluster health params
type ClusterHealthHandler interface {
Handle(ClusterHealthParams) middleware.Responder
}
// NewClusterHealth creates a new http.Handler for the cluster health operation
func NewClusterHealth(ctx *middleware.Context, handler ClusterHealthHandler) *ClusterHealth {
return &ClusterHealth{Context: ctx, Handler: handler}
}
/* ClusterHealth swagger:route GET /cluster_health clusterHealth
Checks the full graph. Returns a binary OK or not OK.
*/
type ClusterHealth struct {
Context *middleware.Context
Handler ClusterHealthHandler
}
func (o *ClusterHealth) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
r = rCtx
}
var Params = NewClusterHealthParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,46 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
)
// NewClusterHealthParams creates a new ClusterHealthParams object
//
// There are no default values defined in the spec.
func NewClusterHealthParams() ClusterHealthParams {
return ClusterHealthParams{}
}
// ClusterHealthParams contains all the bound params for the cluster health operation
// typically these are obtained from a http.Request
//
// swagger:parameters clusterHealth
type ClusterHealthParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewClusterHealthParams() beforehand.
func (o *ClusterHealthParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,102 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// ClusterHealthOKCode is the HTTP code returned for type ClusterHealthOK
const ClusterHealthOKCode int = 200
/*ClusterHealthOK Healthy cluster
swagger:response clusterHealthOK
*/
type ClusterHealthOK struct {
/*
In: Body
*/
Payload *models.ClusterHealthResults `json:"body,omitempty"`
}
// NewClusterHealthOK creates ClusterHealthOK with default headers values
func NewClusterHealthOK() *ClusterHealthOK {
return &ClusterHealthOK{}
}
// WithPayload adds the payload to the cluster health o k response
func (o *ClusterHealthOK) WithPayload(payload *models.ClusterHealthResults) *ClusterHealthOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the cluster health o k response
func (o *ClusterHealthOK) SetPayload(payload *models.ClusterHealthResults) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ClusterHealthOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
// ClusterHealthIMATeapotCode is the HTTP code returned for type ClusterHealthIMATeapot
const ClusterHealthIMATeapotCode int = 418
/*ClusterHealthIMATeapot Unhealthy cluster
swagger:response clusterHealthIMATeapot
*/
type ClusterHealthIMATeapot struct {
/*
In: Body
*/
Payload *models.ClusterHealthResults `json:"body,omitempty"`
}
// NewClusterHealthIMATeapot creates ClusterHealthIMATeapot with default headers values
func NewClusterHealthIMATeapot() *ClusterHealthIMATeapot {
return &ClusterHealthIMATeapot{}
}
// WithPayload adds the payload to the cluster health i m a teapot response
func (o *ClusterHealthIMATeapot) WithPayload(payload *models.ClusterHealthResults) *ClusterHealthIMATeapot {
o.Payload = payload
return o
}
// SetPayload sets the payload to the cluster health i m a teapot response
func (o *ClusterHealthIMATeapot) SetPayload(payload *models.ClusterHealthResults) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ClusterHealthIMATeapot) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(418)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,84 @@
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// ClusterHealthURL generates an URL for the cluster health operation
type ClusterHealthURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *ClusterHealthURL) WithBasePath(bp string) *ClusterHealthURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *ClusterHealthURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *ClusterHealthURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/cluster_health"
_basePath := o._basePath
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *ClusterHealthURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *ClusterHealthURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *ClusterHealthURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on ClusterHealthURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on ClusterHealthURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *ClusterHealthURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -10,13 +10,13 @@ import (
"net/http"
"strings"
errors "github.com/go-openapi/errors"
loads "github.com/go-openapi/loads"
runtime "github.com/go-openapi/runtime"
middleware "github.com/go-openapi/runtime/middleware"
security "github.com/go-openapi/runtime/security"
spec "github.com/go-openapi/spec"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/loads"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/runtime/security"
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -29,20 +29,28 @@ func NewGoldpingerAPI(spec *loads.Document) *GoldpingerAPI {
defaultProduces: "application/json",
customConsumers: make(map[string]runtime.Consumer),
customProducers: make(map[string]runtime.Producer),
PreServerShutdown: func() {},
ServerShutdown: func() {},
spec: spec,
useSwaggerUI: false,
ServeError: errors.ServeError,
BasicAuthenticator: security.BasicAuth,
APIKeyAuthenticator: security.APIKeyAuth,
BearerAuthenticator: security.BearerAuth,
JSONConsumer: runtime.JSONConsumer(),
JSONProducer: runtime.JSONProducer(),
JSONConsumer: runtime.JSONConsumer(),
JSONProducer: runtime.JSONProducer(),
CheckAllPodsHandler: CheckAllPodsHandlerFunc(func(params CheckAllPodsParams) middleware.Responder {
return middleware.NotImplemented("operation CheckAllPods has not yet been implemented")
}),
CheckServicePodsHandler: CheckServicePodsHandlerFunc(func(params CheckServicePodsParams) middleware.Responder {
return middleware.NotImplemented("operation CheckServicePods has not yet been implemented")
}),
ClusterHealthHandler: ClusterHealthHandlerFunc(func(params ClusterHealthParams) middleware.Responder {
return middleware.NotImplemented("operation ClusterHealth has not yet been implemented")
}),
HealthzHandler: HealthzHandlerFunc(func(params HealthzParams) middleware.Responder {
return middleware.NotImplemented("operation Healthz has not yet been implemented")
}),
@@ -63,27 +71,34 @@ type GoldpingerAPI struct {
defaultConsumes string
defaultProduces string
Middleware func(middleware.Builder) http.Handler
useSwaggerUI bool
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
// JSONConsumer registers a consumer for a "application/json" mime type
// JSONConsumer registers a consumer for the following mime types:
// - application/json
JSONConsumer runtime.Consumer
// JSONProducer registers a producer for a "application/json" mime type
// JSONProducer registers a producer for the following mime types:
// - application/json
JSONProducer runtime.Producer
// CheckAllPodsHandler sets the operation handler for the check all pods operation
CheckAllPodsHandler CheckAllPodsHandler
// CheckServicePodsHandler sets the operation handler for the check service pods operation
CheckServicePodsHandler CheckServicePodsHandler
// ClusterHealthHandler sets the operation handler for the cluster health operation
ClusterHealthHandler ClusterHealthHandler
// HealthzHandler sets the operation handler for the healthz operation
HealthzHandler HealthzHandler
// PingHandler sets the operation handler for the ping operation
@@ -93,6 +108,10 @@ type GoldpingerAPI struct {
// but you can set your own with this
ServeError func(http.ResponseWriter, *http.Request, error)
// PreServerShutdown is called before the HTTP(S) server is shutdown
// This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
PreServerShutdown func()
// ServerShutdown is called when the HTTP(S) server is shut down and done
// handling all active connections and does not accept connections any more
ServerShutdown func()
@@ -104,6 +123,16 @@ type GoldpingerAPI struct {
Logger func(string, ...interface{})
}
// UseRedoc for documentation at /docs
func (o *GoldpingerAPI) UseRedoc() {
o.useSwaggerUI = false
}
// UseSwaggerUI for documentation at /docs
func (o *GoldpingerAPI) UseSwaggerUI() {
o.useSwaggerUI = true
}
// SetDefaultProduces sets the default produces media type
func (o *GoldpingerAPI) SetDefaultProduces(mediaType string) {
o.defaultProduces = mediaType
@@ -154,15 +183,15 @@ func (o *GoldpingerAPI) Validate() error {
if o.CheckAllPodsHandler == nil {
unregistered = append(unregistered, "CheckAllPodsHandler")
}
if o.CheckServicePodsHandler == nil {
unregistered = append(unregistered, "CheckServicePodsHandler")
}
if o.ClusterHealthHandler == nil {
unregistered = append(unregistered, "ClusterHealthHandler")
}
if o.HealthzHandler == nil {
unregistered = append(unregistered, "HealthzHandler")
}
if o.PingHandler == nil {
unregistered = append(unregistered, "PingHandler")
}
@@ -181,28 +210,22 @@ func (o *GoldpingerAPI) ServeErrorFor(operationID string) func(http.ResponseWrit
// AuthenticatorsFor gets the authenticators for the specified security schemes
func (o *GoldpingerAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator {
return nil
}
// Authorizer returns the registered authorizer
func (o *GoldpingerAPI) Authorizer() runtime.Authorizer {
return nil
}
// ConsumersFor gets the consumers for the specified media types
// ConsumersFor gets the consumers for the specified media types.
// MIME type parameters are ignored here.
func (o *GoldpingerAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer {
result := make(map[string]runtime.Consumer)
result := make(map[string]runtime.Consumer, len(mediaTypes))
for _, mt := range mediaTypes {
switch mt {
case "application/json":
result["application/json"] = o.JSONConsumer
}
if c, ok := o.customConsumers[mt]; ok {
@@ -210,19 +233,16 @@ func (o *GoldpingerAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Con
}
}
return result
}
// ProducersFor gets the producers for the specified media types
// ProducersFor gets the producers for the specified media types.
// MIME type parameters are ignored here.
func (o *GoldpingerAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer {
result := make(map[string]runtime.Producer)
result := make(map[string]runtime.Producer, len(mediaTypes))
for _, mt := range mediaTypes {
switch mt {
case "application/json":
result["application/json"] = o.JSONProducer
}
if p, ok := o.customProducers[mt]; ok {
@@ -230,7 +250,6 @@ func (o *GoldpingerAPI) ProducersFor(mediaTypes []string) map[string]runtime.Pro
}
}
return result
}
// HandlerFor gets a http.Handler for the provided operation method and path
@@ -260,7 +279,6 @@ func (o *GoldpingerAPI) Context() *middleware.Context {
func (o *GoldpingerAPI) initHandlerCache() {
o.Context() // don't care about the result, just that the initialization happened
if o.handlers == nil {
o.handlers = make(map[string]map[string]http.Handler)
}
@@ -269,22 +287,22 @@ func (o *GoldpingerAPI) initHandlerCache() {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/check_all"] = NewCheckAllPods(o.context, o.CheckAllPodsHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/check"] = NewCheckServicePods(o.context, o.CheckServicePodsHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/cluster_health"] = NewClusterHealth(o.context, o.ClusterHealthHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/healthz"] = NewHealthz(o.context, o.HealthzHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/ping"] = NewPing(o.context, o.PingHandler)
}
// Serve creates a http handler to serve the API over HTTP
@@ -295,6 +313,9 @@ func (o *GoldpingerAPI) Serve(builder middleware.Builder) http.Handler {
if o.Middleware != nil {
return o.Middleware(builder)
}
if o.useSwaggerUI {
return o.context.APIHandlerSwaggerUI(builder)
}
return o.context.APIHandler(builder)
}
@@ -314,3 +335,15 @@ func (o *GoldpingerAPI) RegisterConsumer(mediaType string, consumer runtime.Cons
func (o *GoldpingerAPI) RegisterProducer(mediaType string, producer runtime.Producer) {
o.customProducers[mediaType] = producer
}
// AddMiddlewareFor adds a http middleware to existing handler
func (o *GoldpingerAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) {
um := strings.ToUpper(method)
if path == "/" {
path = ""
}
o.Init()
if h, ok := o.handlers[um][path]; ok {
o.handlers[method][path] = builder(h)
}
}

View File

@@ -8,7 +8,7 @@ package operations
import (
"net/http"
middleware "github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/runtime/middleware"
)
// HealthzHandlerFunc turns a function with the right signature into a healthz handler
@@ -29,7 +29,7 @@ func NewHealthz(ctx *middleware.Context, handler HealthzHandler) *Healthz {
return &Healthz{Context: ctx, Handler: handler}
}
/*Healthz swagger:route GET /healthz healthz
/* Healthz swagger:route GET /healthz healthz
The healthcheck endpoint provides detailed information about the health of a web service. If each of the components required by the service are healthy, then the service is considered healthy and will return a 200 OK response. If any of the components needed by the service are unhealthy, then a 503 Service Unavailable response will be provided.
@@ -45,14 +45,12 @@ func (o *Healthz) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewHealthzParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -13,7 +13,8 @@ import (
)
// NewHealthzParams creates a new HealthzParams object
// no default values defined in spec.
//
// There are no default values defined in the spec.
func NewHealthzParams() HealthzParams {
return HealthzParams{}

View File

@@ -10,7 +10,7 @@ import (
"github.com/go-openapi/runtime"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// HealthzOKCode is the HTTP code returned for type HealthzOK

View File

@@ -8,7 +8,7 @@ package operations
import (
"net/http"
middleware "github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/runtime/middleware"
)
// PingHandlerFunc turns a function with the right signature into a ping handler
@@ -29,7 +29,7 @@ func NewPing(ctx *middleware.Context, handler PingHandler) *Ping {
return &Ping{Context: ctx, Handler: handler}
}
/*Ping swagger:route GET /ping ping
/* Ping swagger:route GET /ping ping
return query stats
@@ -45,14 +45,12 @@ func (o *Ping) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewPingParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -13,7 +13,8 @@ import (
)
// NewPingParams creates a new PingParams object
// no default values defined in spec.
//
// There are no default values defined in the spec.
func NewPingParams() PingParams {
return PingParams{}

View File

@@ -10,7 +10,7 @@ import (
"github.com/go-openapi/runtime"
models "github.com/bloomberg/goldpinger/pkg/models"
"github.com/bloomberg/goldpinger/v3/pkg/models"
)
// PingOKCode is the HTTP code returned for type PingOK

View File

@@ -25,7 +25,7 @@ import (
flags "github.com/jessevdk/go-flags"
"golang.org/x/net/netutil"
"github.com/bloomberg/goldpinger/pkg/restapi/operations"
"github.com/bloomberg/goldpinger/v3/pkg/restapi/operations"
)
const (
@@ -133,7 +133,6 @@ func (s *Server) SetAPI(api *operations.GoldpingerAPI) {
}
s.api = api
s.api.Logger = log.Printf
s.handler = configureAPI(api)
}
@@ -174,8 +173,6 @@ func (s *Server) Serve() (err error) {
go handleInterrupt(once, s)
servers := []*http.Server{}
wg.Add(1)
go s.handleShutdown(wg, &servers)
if s.hasScheme(schemeUnix) {
domainSocket := new(http.Server)
@@ -252,7 +249,7 @@ func (s *Server) Serve() (err error) {
// https://github.com/golang/go/tree/master/src/crypto/elliptic
CurvePreferences: []tls.CurveID{tls.CurveP256},
// Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
NextProtos: []string{"http/1.1", "h2"},
NextProtos: []string{"h2", "http/1.1"},
// https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols
MinVersion: tls.VersionTLS12,
// These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy
@@ -293,7 +290,7 @@ func (s *Server) Serve() (err error) {
// call custom TLS configurator
configureTLS(httpsServer.TLSConfig)
if len(httpsServer.TLSConfig.Certificates) == 0 {
if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil {
// after standard and custom config are passed, this ends up with no certificate
if s.TLSCertificate == "" {
if s.TLSCertificateKey == "" {
@@ -325,6 +322,9 @@ func (s *Server) Serve() (err error) {
}(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig))
}
wg.Add(1)
go s.handleShutdown(wg, &servers)
wg.Wait()
return nil
}
@@ -420,6 +420,9 @@ func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server)
ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout)
defer cancel()
// first execute the pre-shutdown hook
s.api.PreServerShutdown()
shutdownChan := make(chan bool)
for i := range servers {
server := servers[i]
@@ -489,7 +492,7 @@ func (s *Server) TLSListener() (net.Listener, error) {
func handleInterrupt(once *sync.Once, s *Server) {
once.Do(func() {
for _ = range s.interrupt {
for range s.interrupt {
if s.interrupted {
s.Logf("Server already shutting down")
continue

View File

@@ -248,15 +248,19 @@ var main = function(timeout){
var edges = [];
var resp = data.responses;
for (let callId in resp) {
var call = resp[callId].response['podResults'];
if (typeof call !== 'string'){
for (let target in call) {
edges.push({
source: callId,
target: target,
_data: call[target]
});
};
// If there was an error, the response can be undefined,
// especially if there was a timeout/context exceeded
if (resp[callId].response !== undefined) {
var call = resp[callId].response['podResults'];
if (typeof call !== 'string'){
for (let target in call) {
edges.push({
source: callId,
target: target,
_data: call[target]
});
};
}
}
};
@@ -480,6 +484,3 @@ $("#update-heatmap").click(function (e) {
</script>
</body>
</html>

View File

@@ -1,8 +1,8 @@
---
swagger: '2.0'
info:
version: 2.0.0
title: Goldpinger
version: 3.0.0
title: Goldpinger
definitions:
CallStats:
properties:
@@ -37,6 +37,12 @@ definitions:
OK:
type: boolean
default: false
PingTime:
format: date-time
type: string
PodIP:
type: string
format: ipv4
HostIP:
type: string
format: ipv4
@@ -66,6 +72,9 @@ definitions:
OK:
type: boolean
default: false
PodIP:
type: string
format: ipv4
HostIP:
type: string
format: ipv4
@@ -83,16 +92,18 @@ definitions:
type: boolean
default: false
hosts-healthy:
type: integer
type: integer
format: int32
hosts-number:
type: integer
type: integer
format: int32
hosts:
type: array
items:
type: object
properties:
podName:
type: string
hostIP:
type: string
format: ipv4
@@ -119,13 +130,38 @@ definitions:
duration-ns:
type: integer
format: int64
ClusterHealthResults:
type: object
properties:
OK:
type: boolean
default: false
nodesHealthy:
type: array
items:
type: string
nodesUnhealthy:
type: array
items:
type: string
nodesTotal:
type: integer
format: int64
generated-at:
type: string
format: date-time
duration-ns:
type: integer
format: int64
required:
- OK
paths:
/ping:
get:
description: return query stats
produces:
- application/json
operationId: ping
- application/json
operationId: ping
responses:
200:
description: return success
@@ -136,11 +172,11 @@ paths:
description: Queries the API server for all other pods in this service,
and pings them via their pods IPs. Calls their /ping endpoint
produces:
- application/json
operationId: checkServicePods
- application/json
operationId: checkServicePods
responses:
200:
description: Success, return response
description: Success, return response
schema:
$ref: '#/definitions/CheckResults'
/check_all:
@@ -149,13 +185,28 @@ paths:
and makes all of them query all of their neighbours,
using their pods IPs. Calls their /check endpoint.
produces:
- application/json
operationId: checkAllPods
- application/json
operationId: checkAllPods
responses:
200:
description: Success, return response
description: Success, return response
schema:
$ref: '#/definitions/CheckAllResults'
/cluster_health:
get:
description: Checks the full graph. Returns a binary OK or not OK.
produces:
- application/json
operationId: clusterHealth
responses:
200:
description: Healthy cluster
schema:
$ref: '#/definitions/ClusterHealthResults'
418:
description: Unhealthy cluster
schema:
$ref: '#/definitions/ClusterHealthResults'
/healthz:
get:
description: The healthcheck endpoint provides detailed information about