-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Background
Requests to https://versioncheck.linkerd.io/version.json occur from 3 different call sites, and include a UUID query param retrieved via 3 different methods.
Current state
The version check's query params include version, uuid, and source, for example:
https://versioncheck.linkerd.io/version.json?version=v18.9.1&uuid=foo&source=cli
The canonical source for the uuid value is a command-line argument passed to the web process, generated on linkerd install.
3 call sites and uuid retrievals
-
cli
- call site:
linkerd2/pkg/version/version.go
Line 21 in e97be1f
versionCheckURL = "https://versioncheck.linkerd.io/version.json" - uuid retrieval: reads web PodSpec from k8s, parses command-line args
- call site:
-
web
- call site:
let versionUrl = `https://versioncheck.linkerd.io/version.json?version=${this.props.releaseVersion}&uuid=${this.props.uuid}`; - uuid retrieval: passed from web command-line to rendered field in web dashboard
- call site:
-
grafana
- call site:
linkerd2/grafana/dashboards/top-line.json
Line 23 in b708378
"content": "<div>\n <div style=\"position: absolute; top: 0, left: 0\">\n <a href=\"https://linkerd.io\" target=\"_blank\"><img src=\"https://linkerd.io/images/identity/svg/linkerd_primary_color_white.svg\" style=\"height: 30px;\"></a>\n </div>\n <div id=\"version\" style=\"position: absolute; top: 0; right: 0; font-size: 15px\">\n </div>\n</div>\n<script type=\"text/javascript\">\nvar localReqURL =\n window.location.href.substring(\n 0,\n window.location.href.indexOf(\n \"/services/grafana:http/proxy/\"\n )\n )+'/services/web:http/proxy/overview';\n\nfetch(localReqURL, {\n credentials: 'include',\n headers: {\n \"Content-Type\": \"text/html; charset=utf-8\",\n },\n})\n.then(response => response.text())\n.then(text => (new window.DOMParser()).parseFromString(text, \"text/html\"))\n.then(html => {\n var main = html.getElementById('main');\n var localVersion = main.getAttribute(\"data-release-version\");\n var uuid = main.getAttribute(\"data-uuid\");\n\n var versionElem = document.getElementById('version');\n versionElem.innerHTML += 'Running Linkerd ' + localVersion + '.<br>';\n\n fetch('https://versioncheck.linkerd.io/version.json?version='+localVersion+'&uuid='+uuid+'&source=grafana', {\n credentials: 'include',\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n })\n .then(response => response.json())\n .then(json => {\n if (json.version === localVersion) {\n versionElem.innerHTML += 'Linkerd is up to date.';\n } else {\n versionElem.innerHTML += \"A new version (\"+json.version+\") is available. <a href='https://versioncheck.linkerd.io/update' target='_blank'>Update now</a>.\";\n }\n });\n});\n</script>", - uuid retrieval: queries and parses web dashboard html
- call site:
Proposal
- Store the UUID in a single canonical location, possibly as an annotation on the control-plane namespace.
- Provide an endpoint in the public API to retrieve the control-plane's UUID.